mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-15 07:07:07 +00:00
fix a click on the temporary anchor (#397)
Hovering a line in the routing tool shows a temporary anchor, which is drawn in the anchors' layer with the index one past the last anchor. Clicking it reached onClick, which looked that index up in the anchors, got undefined and threw reading its properties. The click now adds the anchor, as a click on the line does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: vcoppe <vianney.coppe@gmail.com>
This commit is contained in:
1 file changed
+5
@@ -633,6 +633,11 @@ export class RoutingControls {
|
||||
|
||||
const anchor = this.anchors[e.features![0].properties.anchorIndex];
|
||||
if (!anchor) {
|
||||
// The temporary anchor on the line is not one of the anchors (nor is a feature
|
||||
// still rendered from before they were rebuilt), a click on it adds it
|
||||
if (e.type === 'click') {
|
||||
this.addIntermediateAnchor(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (e.originalEvent.shiftKey) {
|
||||
|
||||
Reference in new issue
Block a user