Skip to content

Commit

Permalink
Add points to the end of a new route by default, but not for editing …
Browse files Browse the repository at this point in the history
…something existing
  • Loading branch information
dabreegster committed May 31, 2023
1 parent f7fa5f4 commit 24fa17c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/draw/GeometryMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
{:else if currentlyEditingControls == "snap-polygon"}
<SnapPolygonControls {routeTool} />
{:else if currentlyEditingControls == "route"}
<RouteControls {routeTool} />
<RouteControls {routeTool} extendRoute={false} />
{:else}
<p>Click an object to edit its geometry</p>
{/if}
Expand Down
4 changes: 3 additions & 1 deletion src/lib/draw/route/RouteControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import CollapsibleCard from "../../common/CollapsibleCard.svelte";
export let routeTool: RouteTool;
// Start with this enabled or disabled, based on whether we're drawing a new
// route or editing an existing.
export let extendRoute: boolean;
// TODO Save this in the route
let avoidDoublingBack = false;
let extendRoute = false;
$: routeTool.setRouteConfig({
avoid_doubling_back: avoidDoublingBack,
extend_route: extendRoute,
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 @@ -69,5 +69,5 @@
<!-- TODO the text should be fixed, and the progress bar float -->
<div bind:this={progress}>Route tool loading...</div>
{:else if mode == thisMode}
<RouteControls {routeTool} />
<RouteControls {routeTool} extendRoute />
{/if}

0 comments on commit 24fa17c

Please sign in to comment.