Copying from a buffer with no width/height should not fail. Hard exceptions in handlers causes layer task handling to stall.

This commit is contained in:
Michael Jumper
2012-01-10 11:37:10 -08:00
parent 6fc6122e67
commit 0a4931cb41

View File

@@ -141,7 +141,7 @@ Guacamole.Layer = function(width, height) {
// Redraw old data, if any // Redraw old data, if any
if (oldData) if (oldData)
displayContext.drawImage(oldData, displayContext.drawImage(oldData,
0, 0, width, height, 0, 0, width, height,
0, 0, width, height); 0, 0, width, height);
@@ -400,7 +400,10 @@ Guacamole.Layer = function(width, height) {
function doCopyRect() { function doCopyRect() {
if (layer.autosize != 0) fitRect(x, y, srcw, srch); if (layer.autosize != 0) fitRect(x, y, srcw, srch);
displayContext.drawImage(srcLayer.getCanvas(), srcx, srcy, srcw, srch, x, y, srcw, srch);
var srcCanvas = srcLayer.getCanvas();
if (srcCanvas.width != 0 && srcCanvas.height != 0)
displayContext.drawImage(srcCanvas, srcx, srcy, srcw, srch, x, y, srcw, srch);
} }
// If we ARE the source layer, no need to sync. // If we ARE the source layer, no need to sync.