Merge pull request #1647 from bandicoot-imaging-sciences/nn-interp

Set image smoothing options on sketch canvas.
This commit is contained in:
Ian Gilman 2019-04-18 10:54:33 -07:00 committed by GitHub
commit 229515554c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;