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
|
* @param {Canvas} canvas
|
||||||
*/
|
*/
|
||||||
disableImageSmoothing : function (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');
|
var context = canvas.getContext('2d');
|
||||||
context.imageSmoothingEnabled = false;
|
context.imageSmoothingEnabled = smoothing;
|
||||||
context.mozImageSmoothingEnabled = false;
|
context.mozImageSmoothingEnabled = smoothing;
|
||||||
context.oImageSmoothingEnabled = false;
|
context.oImageSmoothingEnabled = smoothing;
|
||||||
context.webkitImageSmoothingEnabled = false;
|
context.webkitImageSmoothingEnabled = smoothing;
|
||||||
context.msImageSmoothingEnabled = false;
|
context.msImageSmoothingEnabled = smoothing;
|
||||||
},
|
},
|
||||||
|
|
||||||
clear : function (canvas) {
|
clear : function (canvas) {
|
||||||
|
Loading…
Reference in New Issue
Block a user