Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.

Commit 52df09f

Browse files
authored
Merge pull request #29 from PsycleResearch/fix/drawzone-path-drawings
fix: Polygon drawings
2 parents 4db60b6 + dc5b738 commit 52df09f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@psycle/repsycle",
3-
"version": "0.0.21",
3+
"version": "0.0.22",
44
"description": "Psycle Research front-end toolkit",
55
"author": "Psycle Research",
66
"keywords": [

src/draw-zone/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,10 +1161,11 @@ function useDraw(
11611161

11621162
if (
11631163
svg.node.contains(e.target as Node) &&
1164-
svg.node !== e.target
1164+
svg.node !== e.target &&
1165+
!startPosition
11651166
) {
11661167
const element = e.target as unknown as LinkedHTMLElement
1167-
startPosition = null
1168+
11681169
element.instance.fire('select')
11691170
return
11701171
} else if (e.target === svg.node) {
@@ -1447,6 +1448,7 @@ function useDraw(
14471448

14481449
// Prevent drawing new rect on rect dragend...
14491450
if ((e.target as Node | null)?.parentNode === svg.node) {
1451+
startPosition = null
14501452
return
14511453
}
14521454

0 commit comments

Comments
 (0)