From 1d3a1e0ccfccfb6d6d57a9d805526c388fb15907 Mon Sep 17 00:00:00 2001 From: yellowtailfan <36425185+yellowtailfan@users.noreply.github.com> Date: Wed, 17 Apr 2019 15:14:23 +1000 Subject: [PATCH] Set image smoothing options on sketch canvas. --- src/drawer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index 3534577e..7c4a433a 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -258,7 +258,7 @@ $.Drawer.prototype = { this.sketchCanvas.width = sketchCanvasSize.x; this.sketchCanvas.height = sketchCanvasSize.y; } - this._updateImageSmoothingEnabled(); + this._updateImageSmoothingEnabled(this.context); } this._clear(); } @@ -343,6 +343,7 @@ $.Drawer.prototype = { self.sketchCanvas.height = sketchCanvasSize.y; }); } + this._updateImageSmoothingEnabled(this.sketchContext); } context = this.sketchContext; } @@ -624,14 +625,13 @@ $.Drawer.prototype = { setImageSmoothingEnabled: function(imageSmoothingEnabled){ if ( this.useCanvas ) { this._imageSmoothingEnabled = imageSmoothingEnabled; - this._updateImageSmoothingEnabled(); + this._updateImageSmoothingEnabled(this.context); this.viewer.forceRedraw(); } }, // private - _updateImageSmoothingEnabled: function(){ - var context = this.context; + _updateImageSmoothingEnabled: function(context){ context.mozImageSmoothingEnabled = this._imageSmoothingEnabled; context.webkitImageSmoothingEnabled = this._imageSmoothingEnabled; context.msImageSmoothingEnabled = this._imageSmoothingEnabled;