Browse Source

Simplify the output scale for css zoom.

Brendan Dahl 12 years ago
parent
commit
52e429550c
  1. 8
      web/page_view.js

8
web/page_view.js

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

Loading…
Cancel
Save