From 53d561fe3603325dd087eb522cd1a731b0df20f2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 15 Feb 2012 12:26:56 -0800 Subject: [PATCH] Layer should preserve composite operation through resize. --- src/main/resources/layer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/resources/layer.js b/src/main/resources/layer.js index 8ec1633..a38ffe8 100644 --- a/src/main/resources/layer.js +++ b/src/main/resources/layer.js @@ -116,7 +116,6 @@ Guacamole.Layer = function(width, height) { */ function resize(newWidth, newHeight) { - // Only preserve old data if width/height are both non-zero var oldData = null; if (width != 0 && height != 0) { @@ -135,6 +134,9 @@ Guacamole.Layer = function(width, height) { } + // Preserve composite operation + var oldCompositeOperation = displayContext.globalCompositeOperation; + // Resize canvas display.width = newWidth; display.height = newHeight; @@ -145,8 +147,12 @@ Guacamole.Layer = function(width, height) { 0, 0, width, height, 0, 0, width, height); + // Restore composite operation + displayContext.globalCompositeOperation = oldCompositeOperation; + width = newWidth; height = newHeight; + } /** -- 1.7.10.4