1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Call AnnotationLayer.setDimensions as part of the render/update-methods (PR 15036 follow-up)

Rather than forcing the user to *manually* call `setDimensions`, which is also breaking any existing third-party code, it seems that we can simply let the `AnnotationLayer.{render, update}`-methods handle that internally.

As far as I can tell, based on testing manually in the viewer *and* running the browser-tests, everything still appears to work correctly with this patch.
This commit is contained in:
Jonas Jenwald 2022-07-04 09:07:10 +02:00
parent ca8b112e8c
commit 552ee9decd
3 changed files with 9 additions and 10 deletions

View file

@ -117,14 +117,11 @@ class AnnotationLayerBuilder {
if (this.div) {
// If an annotationLayer already exists, refresh its children's
// transformation matrices.
AnnotationLayer.setDimensions(this.div, viewport);
AnnotationLayer.update(parameters);
} else {
// Create an annotation layer div and render the annotations
// if there is at least one annotation.
this.div = document.createElement("div");
AnnotationLayer.setDimensions(this.div, viewport);
this.div.className = "annotationLayer";
this.pageDiv.append(this.div);
parameters.div = this.div;