Skip to content

Commit a98bb89

Browse files
committed
Check just the pointer id when sufficient.
1 parent 7e3b3ae commit a98bb89

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/display/editor/draw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ class DrawingEditor extends AnnotationEditor {
797797
}
798798
const { offsetX, offsetY, pointerId } = event;
799799

800-
if (!CurrentPointers.isSamePointerIdOrRemove(pointerId)) {
800+
if (!CurrentPointers.isSamePointerId(pointerId)) {
801801
return;
802802
}
803803
if (CurrentPointers.isUsingMultiplePointers()) {
@@ -827,7 +827,7 @@ class DrawingEditor extends AnnotationEditor {
827827
if (DrawingEditor.#currentDrawingAC) {
828828
DrawingEditor.#currentDrawingAC.abort();
829829
DrawingEditor.#currentDrawingAC = null;
830-
CurrentPointers.clearPointerId();
830+
CurrentPointers.clearPointerIds();
831831
}
832832
}
833833

src/display/editor/tools.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ class CurrentPointers {
7575
CurrentPointers.#moveTimestamp = timeStamp;
7676
}
7777

78+
static isSamePointerId(pointerId) {
79+
return CurrentPointers.#pointerId === pointerId;
80+
}
81+
7882
// Check if it's the same pointer id, otherwise remove it from the set.
7983
static isSamePointerIdOrRemove(pointerId) {
8084
if (CurrentPointers.#pointerId === pointerId) {
@@ -109,7 +113,7 @@ class CurrentPointers {
109113
CurrentPointers.#pointerType = null;
110114
}
111115

112-
static clearPointerId() {
116+
static clearPointerIds() {
113117
CurrentPointers.#pointerId = NaN;
114118
CurrentPointers.#pointerIds = null;
115119
}

0 commit comments

Comments
 (0)