mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Use canvas and css width/height instead of css transform for high dpi.
This commit is contained in:
parent
31fda50123
commit
6ef44da10b
2 changed files with 20 additions and 16 deletions
|
@ -82,8 +82,14 @@ function getFileName(url) {
|
|||
scales. The scaled property is set to false if scaling is
|
||||
not required, true otherwise.
|
||||
*/
|
||||
function getOutputScale() {
|
||||
var pixelRatio = 'devicePixelRatio' in window ? window.devicePixelRatio : 1;
|
||||
function getOutputScale(ctx) {
|
||||
var devicePixelRatio = window.devicePixelRatio || 1;
|
||||
var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
|
||||
ctx.mozBackingStorePixelRatio ||
|
||||
ctx.msBackingStorePixelRatio ||
|
||||
ctx.oBackingStorePixelRatio ||
|
||||
ctx.backingStorePixelRatio || 1;
|
||||
var pixelRatio = devicePixelRatio / backingStoreRatio;
|
||||
return {
|
||||
sx: pixelRatio,
|
||||
sy: pixelRatio,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue