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