mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
The annotation layer dimensions must be set before adding some elements (follow-up of #15770)
In order to move the annotations in the DOM to have something which corresponds to the visual order, we need to have their dimensions/positions which means that the parent must have some dimensions.
This commit is contained in:
parent
0fdac9ba70
commit
1a397681fe
4 changed files with 36 additions and 2 deletions
|
@ -2585,6 +2585,7 @@ class AnnotationLayer {
|
|||
*/
|
||||
static render(parameters) {
|
||||
const { annotations, div, viewport, accessibilityManager } = parameters;
|
||||
setLayerDimensions(div, viewport);
|
||||
|
||||
let zIndex = 0;
|
||||
|
||||
|
@ -2652,7 +2653,6 @@ class AnnotationLayer {
|
|||
}
|
||||
|
||||
this.#setAnnotationCanvasMap(div, parameters.annotationCanvasMap);
|
||||
setLayerDimensions(div, viewport);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2664,9 +2664,9 @@ class AnnotationLayer {
|
|||
*/
|
||||
static update(parameters) {
|
||||
const { annotationCanvasMap, div, viewport } = parameters;
|
||||
setLayerDimensions(div, { rotation: viewport.rotation });
|
||||
|
||||
this.#setAnnotationCanvasMap(div, annotationCanvasMap);
|
||||
setLayerDimensions(div, { rotation: viewport.rotation });
|
||||
div.hidden = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue