mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[GENERIC viewer] Add fallback logic for the old PDFPageView.update
method signature
This is done separately from the previous commit, to make it easier to revert these changes in the future.
This commit is contained in:
parent
7c81a8dd40
commit
8466204384
1 changed files with 17 additions and 0 deletions
|
@ -298,6 +298,23 @@ class PDFPageView {
|
|||
}
|
||||
|
||||
update({ scale = 0, rotation = null, optionalContentConfigPromise = null }) {
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("GENERIC") &&
|
||||
typeof arguments[0] !== "object"
|
||||
) {
|
||||
console.error(
|
||||
"PDFPageView.update called with separate parameters, please use an object instead."
|
||||
);
|
||||
|
||||
this.update({
|
||||
scale: arguments[0],
|
||||
rotation: arguments[1],
|
||||
optionalContentConfigPromise: arguments[2],
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.scale = scale || this.scale;
|
||||
if (typeof rotation === "number") {
|
||||
this.rotation = rotation; // The rotation may be zero.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue