Simplify the output scale for css zoom.

This commit is contained in:
Brendan Dahl 2013-10-08 20:31:49 -07:00
parent df249da923
commit 52e429550c

View File

@ -398,9 +398,11 @@ var PageView = function pageView(container, id, scale,
var outputScale = getOutputScale(ctx);
if (USE_ONLY_CSS_ZOOM) {
// Use a scale that will give a 100% width canvas.
outputScale.sx *= 1 / (viewport.scale / CSS_UNITS);
outputScale.sy *= 1 / (viewport.scale / CSS_UNITS);
var actualSizeViewport = viewport.clone({ scale: CSS_UNITS });
// Use a scale that will make the canvas be the original intended size
// of the page.
outputScale.sx *= actualSizeViewport.width / viewport.width;
outputScale.sy *= actualSizeViewport.height / viewport.height;
outputScale.scaled = true;
}