mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Make copy of canvas, rather than simply returning root layer.
This commit is contained in:
@@ -1172,9 +1172,21 @@ Guacamole.Client = function(tunnel) {
|
|||||||
* layers composited within.
|
* layers composited within.
|
||||||
*/
|
*/
|
||||||
this.flatten = function() {
|
this.flatten = function() {
|
||||||
|
|
||||||
|
// Get source and destination canvases
|
||||||
|
var source = getLayer(0).getCanvas();
|
||||||
|
var canvas = document.createElement("canvas");
|
||||||
|
|
||||||
|
// Set dimensions
|
||||||
|
canvas.width = source.width;
|
||||||
|
canvas.height = source.height;
|
||||||
|
|
||||||
|
// Copy image from source
|
||||||
|
var context = canvas.getContext("2d");
|
||||||
|
context.drawImage(source, 0, 0);
|
||||||
|
|
||||||
// STUB: For now, just return canvas from root layer
|
// Return new canvas copy
|
||||||
return getLayer(0).getCanvas();
|
return canvas;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user