return false;
}
- display.imageRect(x, y, "image/jpeg", data);
+ display.imageRect(x, y, width, height, "image/jpeg", data);
return true;
}
return false;
}
- display.imageRect(x, y, "image/png", data);
+ display.imageRect(x, y, width, height, "image/png", data);
return true;
}
}
}
- imageRect(x, y, mime, arr) {
+ imageRect(x, y, width, height, mime, arr) {
const img = new Image();
img.src = "data: " + mime + ";base64," + Base64.encode(arr);
this._renderQ_push({
'type': 'img',
'img': img,
'x': x,
- 'y': y
+ 'y': y,
+ 'width': width,
+ 'height': height
});
}
break;
case 'img':
if (a.img.complete) {
+ if (a.img.width !== a.width || a.img.height !== a.height) {
+ Log.Error("Decoded image has incorrect dimensions. Got " +
+ a.img.width + "x" + a.img.height + ". Expected " +
+ a.width + "x" + a.height + ".");
+ return;
+ }
this.drawImage(a.img, a.x, a.y);
} else {
a.img._noVNC_display = this;
| flush | () | Resume processing the render queue unless it's empty
| fillRect | (x, y, width, height, color, from_queue) | Draw a filled in rectangle
| copyImage | (old_x, old_y, new_x, new_y, width, height, from_queue) | Copy a rectangular area
-| imageRect | (x, y, mime, arr) | Draw a rectangle with an image
+| imageRect | (x, y, width, height, mime, arr) | Draw a rectangle with an image
| startTile | (x, y, width, height, color) | Begin updating a tile
| subTile | (tile, x, y, w, h, color) | Update a sub-rectangle within the given tile
| finishTile | () | Draw the current tile to the display