Skip to content

Commit

Permalink
GUACAMOLE-2018: Merge convert layer to canvas during exportState() on…
Browse files Browse the repository at this point in the history
…ly if layer is non-empty.
  • Loading branch information
necouchman authored Jan 15, 2025
2 parents c0f7852 + 05c36c4 commit a3b8146
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions guacamole-common-js/src/main/webapp/modules/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ Guacamole.Client = function(tunnel) {

var index = parseInt(key);
var layer = layersSnapshot[key];
var canvas = layer.toCanvas();

// Store layer/buffer dimensions
var exportLayer = {
Expand All @@ -203,8 +202,10 @@ Guacamole.Client = function(tunnel) {
};

// Store layer/buffer image data, if it can be generated
if (layer.width && layer.height)
if (layer.width && layer.height) {
var canvas = layer.toCanvas();
exportLayer.url = canvas.toDataURL('image/png');
}

// Add layer properties if not a buffer nor the default layer
if (index > 0) {
Expand Down

0 comments on commit a3b8146

Please sign in to comment.