[Performance] Only invoke apply on size changes

...as detected from mct-chart.
This commit is contained in:
Victor Woeltjen 2015-12-03 13:28:32 -08:00
parent 9f0114eb39
commit 0f56fd2561

View File

@ -146,6 +146,7 @@ define(
if (canvas.width !== canvas.offsetWidth || if (canvas.width !== canvas.offsetWidth ||
canvas.height !== canvas.offsetHeight) { canvas.height !== canvas.offsetHeight) {
doDraw(scope.draw); doDraw(scope.draw);
scope.$apply();
} }
} }
@ -181,7 +182,7 @@ define(
canvas.addEventListener("webglcontextlost", fallbackFromWebGL); canvas.addEventListener("webglcontextlost", fallbackFromWebGL);
// Check for resize, on a timer // Check for resize, on a timer
activeInterval = $interval(drawIfResized, 1000); activeInterval = $interval(drawIfResized, 1000, 0, false);
// Watch "draw" for external changes to the set of // Watch "draw" for external changes to the set of
// things to be drawn. // things to be drawn.