Merge pull request #20258 from calixteman/cleanup_before_editing_mode
[Editor] Cleanup the pages not being fully rendered before switching to editing mode
This commit is contained in:
commit
0e28b5c3c4
@ -1080,6 +1080,10 @@ class PDFPageView extends BasePDFPageView {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
).then(async () => {
|
).then(async () => {
|
||||||
|
if (this.renderingState !== RenderingStates.FINISHED) {
|
||||||
|
// The rendering has been cancelled.
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.structTreeLayer ||= new StructTreeLayerBuilder(
|
this.structTreeLayer ||= new StructTreeLayerBuilder(
|
||||||
pdfPage,
|
pdfPage,
|
||||||
viewport.rawDims
|
viewport.rawDims
|
||||||
|
|||||||
@ -2525,6 +2525,8 @@ class PDFViewer {
|
|||||||
if (!isEditing) {
|
if (!isEditing) {
|
||||||
this.pdfDocument.annotationStorage.resetModifiedIds();
|
this.pdfDocument.annotationStorage.resetModifiedIds();
|
||||||
}
|
}
|
||||||
|
// We need to cleanup whatever pages being rendered.
|
||||||
|
this.cleanup();
|
||||||
for (const pageView of this._pages) {
|
for (const pageView of this._pages) {
|
||||||
pageView.toggleEditingMode(isEditing);
|
pageView.toggleEditingMode(isEditing);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user