Skip to content

Commit

Permalink
Default to adjusting points when editing an existing route
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 5, 2024
1 parent 4e70c6e commit bc9be84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/draw/EditMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
{#if controls == "point"}
<PointControls {finish} {cancel} />
{:else if controls == "route"}
<RouteControls finish={finishRoute} {cancel} />
<RouteControls finish={finishRoute} {cancel} editingExisting />
{:else if controls == "area"}
<AreaControls finish={finishArea} {cancel} />
{/if}
5 changes: 4 additions & 1 deletion src/lib/draw/route/RouteControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
export let finish: () => void;
export let cancel: () => void;
export let editingExisting: boolean;
onDestroy(() => {
$waypoints = [];
Expand All @@ -31,7 +32,9 @@
}
});
let drawMode: "append-start" | "append-end" | "adjust" = "append-end";
let drawMode: "append-start" | "append-end" | "adjust" = editingExisting
? "adjust"
: "append-end";
let snapMode = true;
let undoStates: Waypoint[][] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/draw/route/RouteMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
}
</script>

<RouteControls {finish} cancel={onFailure} />
<RouteControls {finish} cancel={onFailure} editingExisting={false} />

0 comments on commit bc9be84

Please sign in to comment.