Hide the struct tree layer during zooming
This commit is contained in:
parent
05d821e680
commit
5bd352f69b
@ -417,6 +417,7 @@ class PDFPageView {
|
||||
if (treeDom) {
|
||||
this.canvas?.append(treeDom);
|
||||
}
|
||||
this.structTreeLayer?.show();
|
||||
}
|
||||
|
||||
async #buildXfaTextContentItems(textDivs) {
|
||||
@ -505,6 +506,7 @@ class PDFPageView {
|
||||
if (textLayerNode) {
|
||||
this.textLayer.hide();
|
||||
}
|
||||
this.structTreeLayer?.hide();
|
||||
|
||||
if (!zoomLayerNode) {
|
||||
if (this.canvas) {
|
||||
@ -776,6 +778,7 @@ class PDFPageView {
|
||||
if (this.textLayer) {
|
||||
if (hideTextLayer) {
|
||||
this.textLayer.hide();
|
||||
this.structTreeLayer?.hide();
|
||||
} else if (redrawTextLayer) {
|
||||
this.#renderTextLayer();
|
||||
}
|
||||
|
@ -149,6 +149,10 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pdfViewer .page canvas .structTree {
|
||||
contain: strict;
|
||||
}
|
||||
|
||||
.pdfViewer .page canvas[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
@ -87,6 +87,18 @@ class StructTreeLayerBuilder {
|
||||
return (this.#treeDom = treeDom);
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (this.#treeDom && !this.#treeDom.hidden) {
|
||||
this.#treeDom.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
show() {
|
||||
if (this.#treeDom?.hidden) {
|
||||
this.#treeDom.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
#setAttributes(structElement, htmlElement) {
|
||||
if (structElement.alt !== undefined) {
|
||||
htmlElement.setAttribute("aria-label", structElement.alt);
|
||||
|
Loading…
Reference in New Issue
Block a user