mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +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.#updateModeCapability = Promise.withResolvers();
|
||||||
|
this.#currentDrawingSession?.commitOrRemove();
|
||||||
|
|
||||||
this.#mode = mode;
|
this.#mode = mode;
|
||||||
if (mode === AnnotationEditorType.NONE) {
|
if (mode === AnnotationEditorType.NONE) {
|
||||||
|
|
|
@ -215,9 +215,12 @@ class TouchManager {
|
||||||
if (evt.touches.length >= 2) {
|
if (evt.touches.length >= 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.#touchMoveAC.abort();
|
// #touchMoveAC shouldn't be null but it seems that irl it can (see #19793).
|
||||||
this.#touchMoveAC = null;
|
if (this.#touchMoveAC) {
|
||||||
this.#onPinchEnd?.();
|
this.#touchMoveAC.abort();
|
||||||
|
this.#touchMoveAC = null;
|
||||||
|
this.#onPinchEnd?.();
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.#touchInfo) {
|
if (!this.#touchInfo) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue