Commit 897714dd authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

add initContextSmoothing

При смене ориентации у планшета, сбрасываются флаги у canvas!

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54246 954022d7-b5bf-4e40-9824-e11837661b57
parent f61d9701
...@@ -483,17 +483,8 @@ DrawingContext.prototype = { ...@@ -483,17 +483,8 @@ DrawingContext.prototype = {
setCanvas: function (canvas) { setCanvas: function (canvas) {
if (null == canvas) {return;} if (null == canvas) {return;}
this.canvas = canvas; this.canvas = canvas;
var ctx = this.ctx = this.canvas.getContext("2d"); this.ctx = this.canvas.getContext("2d");
this.initContextSmoothing();
// Не убирать. Баг на android при scroll!!!
if (ctx.imageSmoothingEnabled)
ctx.imageSmoothingEnabled = false;
if (ctx.mozImageSmoothingEnabled)
ctx.mozImageSmoothingEnabled = false;
if (ctx.oImageSmoothingEnabled)
ctx.oImageSmoothingEnabled = false;
if (ctx.webkitImageSmoothingEnabled)
ctx.webkitImageSmoothingEnabled = false;
}, },
/** /**
...@@ -597,6 +588,22 @@ DrawingContext.prototype = { ...@@ -597,6 +588,22 @@ DrawingContext.prototype = {
return this; return this;
}, },
/**
* Delete smoothing
*/
initContextSmoothing: function () {
var ctx = this.ctx;
// Не убирать. Баг на android при scroll!!!
if (ctx.imageSmoothingEnabled)
ctx.imageSmoothingEnabled = false;
if (ctx.mozImageSmoothingEnabled)
ctx.mozImageSmoothingEnabled = false;
if (ctx.oImageSmoothingEnabled)
ctx.oImageSmoothingEnabled = false;
if (ctx.webkitImageSmoothingEnabled)
ctx.webkitImageSmoothingEnabled = false;
},
// Canvas methods // Canvas methods
clear: function () { clear: function () {
......
...@@ -1172,6 +1172,11 @@ ...@@ -1172,6 +1172,11 @@
this.canvas.width = this.canvasOverlay.width = width; this.canvas.width = this.canvasOverlay.width = width;
this.canvas.height = this.canvasOverlay.height = height; this.canvas.height = this.canvasOverlay.height = height;
// При смене ориентации у планшета, сбрасываются флаги у canvas!
this.drawingCtx.initContextSmoothing();
this.overlayCtx.initContextSmoothing();
this.drawingCtxCharts.initContextSmoothing();
return true; return true;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment