*/
function resize(newWidth, newHeight) {
-
// Only preserve old data if width/height are both non-zero
var oldData = null;
if (width != 0 && height != 0) {
}
+ // Preserve composite operation
+ var oldCompositeOperation = displayContext.globalCompositeOperation;
+
// Resize canvas
display.width = newWidth;
display.height = newHeight;
0, 0, width, height,
0, 0, width, height);
+ // Restore composite operation
+ displayContext.globalCompositeOperation = oldCompositeOperation;
+
width = newWidth;
height = newHeight;
+
}
/**