Reduce unnecessary duplication when cancelling annotationLayer
/xfaLayer
rendering
There's no good reason, as far as I can tell, to have `PDFPageView.reset` attempt to cancel `annotationLayer`/`xfaLayer` rendering in one special-case (this is mostly a leftover from older code). Previously cancelling was moved into the separate `PDFPageView.cancelRendering`-method, and by slightly tweaking the conditions there we're able to remove a bit of now unnecessary code from the `PDFPageView.reset`-method.
This commit is contained in:
parent
d22ffbbc0a
commit
f85f579971
@ -240,18 +240,11 @@ class PDFPageView {
|
|||||||
// Hide the annotation layer until all elements are resized
|
// Hide the annotation layer until all elements are resized
|
||||||
// so they are not displayed on the already resized page.
|
// so they are not displayed on the already resized page.
|
||||||
this.annotationLayer.hide();
|
this.annotationLayer.hide();
|
||||||
} else if (this.annotationLayer) {
|
|
||||||
this.annotationLayer.cancel();
|
|
||||||
this.annotationLayer = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xfaLayerNode) {
|
if (xfaLayerNode) {
|
||||||
// Hide the XFA layer until all elements are resized
|
// Hide the XFA layer until all elements are resized
|
||||||
// so they are not displayed on the already resized page.
|
// so they are not displayed on the already resized page.
|
||||||
this.xfaLayer.hide();
|
this.xfaLayer.hide();
|
||||||
} else if (this.xfaLayer) {
|
|
||||||
this.xfaLayer.cancel();
|
|
||||||
this.xfaLayer = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zoomLayerNode) {
|
if (!zoomLayerNode) {
|
||||||
@ -374,11 +367,14 @@ class PDFPageView {
|
|||||||
this.textLayer.cancel();
|
this.textLayer.cancel();
|
||||||
this.textLayer = null;
|
this.textLayer = null;
|
||||||
}
|
}
|
||||||
if (!keepAnnotationLayer && this.annotationLayer) {
|
if (
|
||||||
|
this.annotationLayer &&
|
||||||
|
(!keepAnnotationLayer || !this.annotationLayer.div)
|
||||||
|
) {
|
||||||
this.annotationLayer.cancel();
|
this.annotationLayer.cancel();
|
||||||
this.annotationLayer = null;
|
this.annotationLayer = null;
|
||||||
}
|
}
|
||||||
if (!keepXfaLayer && this.xfaLayer) {
|
if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {
|
||||||
this.xfaLayer.cancel();
|
this.xfaLayer.cancel();
|
||||||
this.xfaLayer = null;
|
this.xfaLayer = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user