imageSmoothingEnabled is being set to correct value after resize

This commit is contained in:
Yochay Doutsh 2019-02-06 17:47:07 +02:00
parent 578ff36a06
commit 1e538e665d

View File

@ -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();
}