mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #14055 from Snuffleupagus/PDF_TO_CSS_UNITS
Add `PDF_TO_CSS_UNITS` to the `PixelsPerInch`-structure
This commit is contained in:
commit
5254676ef3
7 changed files with 38 additions and 22 deletions
|
@ -879,7 +879,7 @@ function getImageSmoothingEnabled(transform, interpolate) {
|
|||
scale[0] = Math.fround(scale[0]);
|
||||
scale[1] = Math.fround(scale[1]);
|
||||
const actualScale = Math.fround(
|
||||
((globalThis.devicePixelRatio || 1) * PixelsPerInch.CSS) / PixelsPerInch.PDF
|
||||
(globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS
|
||||
);
|
||||
if (interpolate !== undefined) {
|
||||
// If the value is explicitly set use it.
|
||||
|
|
|
@ -18,6 +18,7 @@ import {
|
|||
BaseException,
|
||||
isString,
|
||||
removeNullCharacters,
|
||||
shadow,
|
||||
stringToBytes,
|
||||
Util,
|
||||
warn,
|
||||
|
@ -35,6 +36,11 @@ const SVG_NS = "http://www.w3.org/2000/svg";
|
|||
const PixelsPerInch = {
|
||||
CSS: 96.0,
|
||||
PDF: 72.0,
|
||||
|
||||
/** @type {number} */
|
||||
get PDF_TO_CSS_UNITS() {
|
||||
return shadow(this, "PDF_TO_CSS_UNITS", this.CSS / this.PDF);
|
||||
},
|
||||
};
|
||||
|
||||
class DOMCanvasFactory extends BaseCanvasFactory {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue