From 27dcb79e5018b15f1fd8021d5c728995f24d7632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Roux?= Date: Fri, 21 Apr 2017 11:57:48 +0200 Subject: [PATCH] Create the canvas only if it does not already exist (#55) --- src/display/image/Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/image/Image.js b/src/display/image/Image.js index b699b07f..ed54400a 100644 --- a/src/display/image/Image.js +++ b/src/display/image/Image.js @@ -375,7 +375,7 @@ FORGE.Image.prototype._setRenderMode = function(mode) { this._dom.style.backgroundRepeat = "no-repeat"; } - else if(this._renderMode === FORGE.Image.renderModes.CANVAS) + else if(this._renderMode === FORGE.Image.renderModes.CANVAS && this._canvas === null) { this._canvas = document.createElement("canvas"); this._canvas.style.position = "absolute";