Skip to content

Commit c3dda43

Browse files
committed
Fix: glitch in range selection
1 parent c904c27 commit c3dda43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/events/selection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ const useSelection = () => {
6060
this.update(newX, newY);
6161
},
6262
update: function (newX: number, newY: number) {
63-
this.currentX = newX - (+this.element?.attr("width") > 2 ? workspaceLeft : 0);
64-
this.currentY = newY - (+this.element?.attr("height") > 2 ? workspaceTop : 0);
63+
this.currentX = newX - (+this.element?.attr("width") || this.currentX === this.originX ? workspaceLeft : 0);
64+
this.currentY = newY - (+this.element?.attr("height") || this.currentY === this.originY ? workspaceTop : 0);
6565
const attributes = this.getNewAttributes();
6666
Object.keys(attributes).forEach((key) => {
6767
this.element.attr(key, attributes[key]);

0 commit comments

Comments
 (0)