Skip to content

Commit c8ac815

Browse files
committed
Clear pointer type outside of the DrawingEditor to always keep the same, until the user changes the mode.
1 parent a98bb89 commit c8ac815

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/display/editor/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ class DrawingEditor extends AnnotationEditor {
820820
this._currentParent = null;
821821
DrawingEditor.#currentDraw = null;
822822
DrawingEditor.#currentDrawingOptions = null;
823-
CurrentPointers.clearPointerType();
824823
CurrentPointers.clearTimeStamp();
825824
}
826825

src/display/editor/tools.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,13 +1877,16 @@ class AnnotationEditorUIManager {
18771877
* edit mode.
18781878
* @param {boolean} [editComment] - true if the mode change is due to a
18791879
* comment edit.
1880+
* @param {boolean} [isFromEvent] - true if the mode change is due to an event
1881+
* (e.g. toolbar button clicked).
18801882
*/
18811883
async updateMode(
18821884
mode,
18831885
editId = null,
18841886
isFromKeyboard = false,
18851887
mustEnterInEditMode = false,
1886-
editComment = false
1888+
editComment = false,
1889+
isFromEvent = false
18871890
) {
18881891
if (this.#mode === mode) {
18891892
return;
@@ -1921,6 +1924,10 @@ class AnnotationEditorUIManager {
19211924
if (mode === AnnotationEditorType.SIGNATURE) {
19221925
await this.#signatureManager?.loadSignatures();
19231926
}
1927+
if (isFromEvent) {
1928+
// reinitialize the pointer type when mode changed by an event
1929+
CurrentPointers.clearPointerType();
1930+
}
19241931

19251932
this.setEditingState(true);
19261933
await this.#enableAll();

0 commit comments

Comments
 (0)