Merge pull request #14580 from Snuffleupagus/PixelsPerInch-class

Change `PixelsPerInch` to a class with `static` properties (issue 14579)
This commit is contained in:
Tim van der Meij 2022-02-19 14:49:50 +01:00 committed by GitHub
commit 65d679a3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,6 @@ import {
import {
BaseException,
isString,
shadow,
stringToBytes,
Util,
warn,
@ -30,15 +29,13 @@ import {
const SVG_NS = "http://www.w3.org/2000/svg";
const PixelsPerInch = {
CSS: 96.0,
PDF: 72.0,
class PixelsPerInch {
static CSS = 96.0;
/** @type {number} */
get PDF_TO_CSS_UNITS() {
return shadow(this, "PDF_TO_CSS_UNITS", this.CSS / this.PDF);
},
};
static PDF = 72.0;
static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
}
class DOMCanvasFactory extends BaseCanvasFactory {
constructor({ ownerDocument = globalThis.document } = {}) {