1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 07:38:07 +02:00

Merge pull request #5828 from Rob--W/mozCurrentTransform-fix

Fix flaw in mozCurrentTransform polyfill
This commit is contained in:
Tim van der Meij 2015-04-29 19:27:02 +02:00
commit 6159da0598
2 changed files with 13 additions and 8 deletions

View file

@ -363,10 +363,11 @@ var PDFPageView = (function PDFPageViewClosure() {
}
this.textLayer = textLayer;
// TODO(mack): use data attributes to store these
ctx._scaleX = outputScale.sx;
ctx._scaleY = outputScale.sy;
if (outputScale.scaled) {
//#if !(MOZCENTRAL || FIREFOX)
// Used by the mozCurrentTransform polyfill in src/display/canvas.js.
ctx._transformMatrix = [outputScale.sx, 0, 0, outputScale.sy, 0, 0];
//#endif
ctx.scale(outputScale.sx, outputScale.sy);
}
@ -517,6 +518,11 @@ var PDFPageView = (function PDFPageViewClosure() {
ctx.fillStyle = 'rgb(255, 255, 255)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore();
//#if !(MOZCENTRAL || FIREFOX)
// Used by the mozCurrentTransform polyfill in src/display/canvas.js.
ctx._transformMatrix =
[PRINT_OUTPUT_SCALE, 0, 0, PRINT_OUTPUT_SCALE, 0, 0];
//#endif
ctx.scale(PRINT_OUTPUT_SCALE, PRINT_OUTPUT_SCALE);
var renderContext = {