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

Merge pull request #19797 from calixteman/issue19793

[Editor] Commit the current drawing before switching the current mode
This commit is contained in:
calixteman 2025-04-10 21:34:51 +02:00 committed by GitHub
commit 539a81c7a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;