mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Don't create an observer for the stamp annotation after the viewer has been closed
This commit is contained in:
parent
3e1d779859
commit
7d7ae34e34
2 changed files with 20 additions and 12 deletions
|
@ -538,6 +538,11 @@ class StampEditor extends AnnotationEditor {
|
|||
* Create the resize observer.
|
||||
*/
|
||||
#createObserver() {
|
||||
if (!this._uiManager._signal) {
|
||||
// This method is called after the canvas has been created but the canvas
|
||||
// creation is async, so it's possible that the viewer has been closed.
|
||||
return;
|
||||
}
|
||||
this.#observer = new ResizeObserver(entries => {
|
||||
const rect = entries[0].contentRect;
|
||||
if (rect.width && rect.height) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue