From 1e538e665d55bcada2ffae744e7b8fc33162bb5b Mon Sep 17 00:00:00 2001 From: Yochay Doutsh Date: Wed, 6 Feb 2019 17:47:07 +0200 Subject: [PATCH] imageSmoothingEnabled is being set to correct value after resize --- src/drawer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drawer.js b/src/drawer.js index 5a70bb1e..66bd3a26 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -247,6 +247,7 @@ $.Drawer.prototype = { var viewportSize = this._calculateCanvasSize(); if( this.canvas.width != viewportSize.x || this.canvas.height != viewportSize.y ) { + var imageSmoothingEnabled = this.canvas.getContext('2d').imageSmoothingEnabled; this.canvas.width = viewportSize.x; this.canvas.height = viewportSize.y; if ( this.sketchCanvas !== null ) { @@ -254,6 +255,7 @@ $.Drawer.prototype = { this.sketchCanvas.width = sketchCanvasSize.x; this.sketchCanvas.height = sketchCanvasSize.y; } + this.setImageSmoothingEnabled(imageSmoothingEnabled); } this._clear(); }