1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 16:48:08 +02:00

[Editor] Commit the current drawing before switching the current mode

It fixes #19793.
This commit is contained in:
Calixte Denizet 2025-04-10 14:52:51 +02:00
parent 220a28933c
commit 61df54c689
2 changed files with 7 additions and 3 deletions

View file

@ -1680,6 +1680,7 @@ class AnnotationEditorUIManager {
}
this.#updateModeCapability = Promise.withResolvers();
this.#currentDrawingSession?.commitOrRemove();
this.#mode = mode;
if (mode === AnnotationEditorType.NONE) {

View file

@ -215,9 +215,12 @@ class TouchManager {
if (evt.touches.length >= 2) {
return;
}
this.#touchMoveAC.abort();
this.#touchMoveAC = null;
this.#onPinchEnd?.();
// #touchMoveAC shouldn't be null but it seems that irl it can (see #19793).
if (this.#touchMoveAC) {
this.#touchMoveAC.abort();
this.#touchMoveAC = null;
this.#onPinchEnd?.();
}
if (!this.#touchInfo) {
return;