Skip to content

Commit b403e6e

Browse files
committed
fix: allow clicking on things outside of annotation layer with pen active
1 parent 478be52 commit b403e6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/UI/pen.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ let lines = [];
2020
* @param {PointerEvent} e The DOM event to be handled
2121
*/
2222
function handleDocumentPointerdown(e) {
23-
e.preventDefault();
2423
path = null;
2524
lines = [];
2625
_candraw = true;
26+
if (!e.srcElement.classList.contains('annotationLayer')) {
27+
return;
28+
}
29+
e.preventDefault();
2730
}
2831

2932
/**
@@ -179,4 +182,3 @@ export function disablePen() {
179182
document.removeEventListener('keyup', handleDocumentKeyup);
180183
enableUserSelect();
181184
}
182-

0 commit comments

Comments
 (0)