feature : zoom level : code review

+ added explanatory comment for CanvasUtils.disableImageSmoothing
+ detect browser for chosing wheel/mousewheel event in DrawingController
+ create ABSTRACT_FUNCTION constant to be reused forabstract methods
This commit is contained in:
jdescottes
2013-11-15 00:32:18 +01:00
parent c8a8d470a7
commit 3af64d3f45
4 changed files with 27 additions and 14 deletions

View File

@ -19,6 +19,13 @@
return canvas;
},
/**
* By default, all scaling operations on a Canvas 2D Context are performed using antialiasing.
* Resizing a 32x32 image to 320x320 will lead to a blurry output.
* On Chrome, FF and IE>=11, this can be disabled by setting a property on the Canvas 2D Context.
* In this case the browser will use a nearest-neighbor scaling.
* @param {Canvas} canvas
*/
disableImageSmoothing : function (canvas) {
var context = canvas.getContext('2d');
context.imageSmoothingEnabled = false;