mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Added method to enable image smoothing on Canvas
This commit is contained in:
parent
4f2f01ea36
commit
bcb709300c
@ -41,12 +41,20 @@
|
||||
* @param {Canvas} canvas
|
||||
*/
|
||||
disableImageSmoothing : function (canvas) {
|
||||
pskl.utils.CanvasUtils.setImageSmoothing(canvas, false);
|
||||
},
|
||||
|
||||
enableImageSmoothing : function (canvas) {
|
||||
pskl.utils.CanvasUtils.setImageSmoothing(canvas, true);
|
||||
},
|
||||
|
||||
setImageSmoothing : function (canvas, smoothing) {
|
||||
var context = canvas.getContext('2d');
|
||||
context.imageSmoothingEnabled = false;
|
||||
context.mozImageSmoothingEnabled = false;
|
||||
context.oImageSmoothingEnabled = false;
|
||||
context.webkitImageSmoothingEnabled = false;
|
||||
context.msImageSmoothingEnabled = false;
|
||||
context.imageSmoothingEnabled = smoothing;
|
||||
context.mozImageSmoothingEnabled = smoothing;
|
||||
context.oImageSmoothingEnabled = smoothing;
|
||||
context.webkitImageSmoothingEnabled = smoothing;
|
||||
context.msImageSmoothingEnabled = smoothing;
|
||||
},
|
||||
|
||||
clear : function (canvas) {
|
||||
|
Loading…
Reference in New Issue
Block a user