Skip to content

Commit

Permalink
web: reset line tool when closing polyline
Browse files Browse the repository at this point in the history
  • Loading branch information
av8ta committed Jun 3, 2024
1 parent 7a80bb5 commit a67b516
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion applications/web/src/components/tools/NewLine.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function processPoint(point: PointLikeById) {
pushToStack(point)
previousPoint = point
switch (stack.length) {
case 0: // nothing to do, the stack is empty
Expand All @@ -40,9 +41,11 @@
// leave the current point on the stack in case we want to create another line from here
pushToStack(point)
// unless it's an earlier point, which means we're finished making lines, so we clear the stack
const isEarlierPoint = !!pointsById[point.id!]
if (isEarlierPoint) clearStack()
break
}
previousPoint = point
}
export function click(_event: Event, projected: Point) {
Expand Down

0 comments on commit a67b516

Please sign in to comment.