Merge pull request #19019 from Snuffleupagus/userUnit-shorten
Shorten the `Page.prototype.userUnit` getter slightly
This commit is contained in:
commit
b9c17efe35
@ -74,7 +74,6 @@ import { writeObject } from "./writer.js";
|
|||||||
import { XFAFactory } from "./xfa/factory.js";
|
import { XFAFactory } from "./xfa/factory.js";
|
||||||
import { XRef } from "./xref.js";
|
import { XRef } from "./xref.js";
|
||||||
|
|
||||||
const DEFAULT_USER_UNIT = 1.0;
|
|
||||||
const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
|
const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
|
||||||
|
|
||||||
class Page {
|
class Page {
|
||||||
@ -195,11 +194,12 @@ class Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get userUnit() {
|
get userUnit() {
|
||||||
let obj = this.pageDict.get("UserUnit");
|
const obj = this.pageDict.get("UserUnit");
|
||||||
if (typeof obj !== "number" || obj <= 0) {
|
return shadow(
|
||||||
obj = DEFAULT_USER_UNIT;
|
this,
|
||||||
}
|
"userUnit",
|
||||||
return shadow(this, "userUnit", obj);
|
typeof obj === "number" && obj > 0 ? obj : 1.0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get view() {
|
get view() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user