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:
commit
539a81c7a3
2 changed files with 7 additions and 3 deletions
|
@ -1680,6 +1680,7 @@ class AnnotationEditorUIManager {
|
|||
}
|
||||
|
||||
this.#updateModeCapability = Promise.withResolvers();
|
||||
this.#currentDrawingSession?.commitOrRemove();
|
||||
|
||||
this.#mode = mode;
|
||||
if (mode === AnnotationEditorType.NONE) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue