Move putImageData
This commit is contained in:
parent
81681e7914
commit
50b86ff480
@ -1150,17 +1150,17 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
|
|
||||||
applyStencilMask(pixels, inverseDecode);
|
applyStencilMask(pixels, inverseDecode);
|
||||||
|
|
||||||
tmpCtx.putImageData(imgData, 0, 0);
|
|
||||||
var currentTransform = ctx.mozCurrentTransformInverse;
|
var currentTransform = ctx.mozCurrentTransformInverse;
|
||||||
var widthScale = Math.max(Math.abs(currentTransform[0]), 1);
|
var widthScale = Math.max(Math.abs(currentTransform[0]), 1);
|
||||||
var heightScale = Math.max(Math.abs(currentTransform[3]), 1);
|
var heightScale = Math.max(Math.abs(currentTransform[3]), 1);
|
||||||
if (widthScale >= 2 || heightScale >= 2) {
|
if (widthScale >= 2 || heightScale >= 2) {
|
||||||
// canvas does not resize large images to small -- using simple
|
// canvas does not resize well large images to small -- using simple
|
||||||
// algorithm to perform pre-scaling
|
// algorithm to perform pre-scaling
|
||||||
tmpCanvas = rescaleImage(imgData.data, widthScale, heightScale);
|
tmpCanvas = rescaleImage(imgData.data, widthScale, heightScale);
|
||||||
ctx.scale(widthScale, heightScale);
|
ctx.scale(widthScale, heightScale);
|
||||||
ctx.drawImage(tmpCanvas, 0, -h / heightScale);
|
ctx.drawImage(tmpCanvas, 0, -h / heightScale);
|
||||||
} else
|
} else
|
||||||
|
tmpCtx.putImageData(imgData, 0, 0);
|
||||||
ctx.drawImage(tmpCanvas, 0, -h);
|
ctx.drawImage(tmpCanvas, 0, -h);
|
||||||
this.restore();
|
this.restore();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user