[api-minor] Change {PDFPageView, PDFThumbnailView}.update to take a parameter object

The old `update`-signature started to annoy me back when I added optional content support to the viewer, since we're (often) forced to pass in a bunch of arguments that we don't care about whenever these methods are called.

This is tagged `api-minor` since `PDFPageView` is being used in the `pageviewer` component example, and it's thus possible that these changes could affect some users; the next commit adds fallback handling for the old format.
This commit is contained in:
Jonas Jenwald 2021-08-31 17:08:43 +02:00
parent 258cf1decc
commit 7c81a8dd40
4 changed files with 17 additions and 15 deletions

View file

@ -144,8 +144,9 @@ class PDFThumbnailViewer {
}
this._pagesRotation = rotation;
for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
this._thumbnails[i].update(rotation);
const updateArgs = { rotation };
for (const thumbnail of this._thumbnails) {
thumbnail.update(updateArgs);
}
}