mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Avoid wrong scrolling when calling zoomReset
The goal of this patch is to fix the test: https://searchfox.org/mozilla-central/source/toolkit/components/pdfjs/test/browser_pdfjs_zoom.js It's a regression due to #17790.
This commit is contained in:
parent
ae60221b0e
commit
918b500ca5
3 changed files with 38 additions and 2 deletions
|
@ -127,7 +127,6 @@ class AnnotationEditorLayerBuilder {
|
|||
return;
|
||||
}
|
||||
this.annotationEditorLayer.destroy();
|
||||
this.div.remove();
|
||||
}
|
||||
|
||||
hide() {
|
||||
|
|
|
@ -104,7 +104,7 @@ const LAYERS_ORDER = new Map([
|
|||
["textLayer", 1],
|
||||
["annotationLayer", 2],
|
||||
["annotationEditorLayer", 3],
|
||||
["xfaLayer", 2],
|
||||
["xfaLayer", 3],
|
||||
]);
|
||||
|
||||
/**
|
||||
|
@ -235,7 +235,12 @@ class PDFPageView {
|
|||
|
||||
#addLayer(div, name) {
|
||||
const pos = LAYERS_ORDER.get(name);
|
||||
const oldDiv = this.#layers[pos];
|
||||
this.#layers[pos] = div;
|
||||
if (oldDiv) {
|
||||
oldDiv.replaceWith(div);
|
||||
return;
|
||||
}
|
||||
for (let i = pos - 1; i >= 0; i--) {
|
||||
const layer = this.#layers[i];
|
||||
if (layer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue