GUACAMOLE-884: Note that the drawImage() functions accept anything implementing the CanvasImageSource interface, not just Image.

This commit is contained in:
Michael Jumper
2019-09-29 22:17:45 -07:00
parent 6649c5d334
commit 1e9ddc2183
2 changed files with 19 additions and 9 deletions

View File

@@ -512,11 +512,17 @@ Guacamole.Display = function() {
* Draws the specified image at the given coordinates. The image specified * Draws the specified image at the given coordinates. The image specified
* must already be loaded. * must already be loaded.
* *
* @param {Guacamole.Layer} layer The layer to draw upon. * @param {Guacamole.Layer} layer
* @param {Number} x The destination X coordinate. * The layer to draw upon.
* @param {Number} y The destination Y coordinate. *
* @param {Image} image The image to draw. Note that this is an Image * @param {Number} x
* object - not a URL. * The destination X coordinate.
*
* @param {Number} y
* The destination Y coordinate.
*
* @param {CanvasImageSource} image
* The image to draw. Note that this not a URL.
*/ */
this.drawImage = function(layer, x, y, image) { this.drawImage = function(layer, x, y, image) {
scheduleTask(function __display_drawImage() { scheduleTask(function __display_drawImage() {

View File

@@ -319,10 +319,14 @@ Guacamole.Layer = function(width, height) {
* Draws the specified image at the given coordinates. The image specified * Draws the specified image at the given coordinates. The image specified
* must already be loaded. * must already be loaded.
* *
* @param {Number} x The destination X coordinate. * @param {Number} x
* @param {Number} y The destination Y coordinate. * The destination X coordinate.
* @param {Image} image The image to draw. Note that this is an Image *
* object - not a URL. * @param {Number} y
* The destination Y coordinate.
*
* @param {CanvasImageSource} image
* The image to draw. Note that this is not a URL.
*/ */
this.drawImage = function(x, y, image) { this.drawImage = function(x, y, image) {
if (layer.autosize) fitRect(x, y, image.width, image.height); if (layer.autosize) fitRect(x, y, image.width, image.height);