X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/fe7e4e45d4c5bf08af35422fc0a2d4289f821815..bd78ae7d70bd7388d4950f3e7331b72f84eab208:/src/viktrwlayer.c diff --git a/src/viktrwlayer.c b/src/viktrwlayer.c index 1f66c155..a5d79e1d 100644 --- a/src/viktrwlayer.c +++ b/src/viktrwlayer.c @@ -8294,8 +8294,12 @@ static gboolean trw_layer_select_release ( VikTrwLayer *vtl, GdkEventButton *eve // Determine if working on a waypoint or a trackpoint if ( t->is_waypoint ) { + // Update waypoint position vtl->current_wp->coord = new_coord; trw_layer_calculate_bounds_waypoints ( vtl ); + // Reset waypoint pointer + vtl->current_wp = NULL; + vtl->current_wp_id = NULL; } else { if ( vtl->current_tpl ) { @@ -8304,17 +8308,13 @@ static gboolean trw_layer_select_release ( VikTrwLayer *vtl, GdkEventButton *eve if ( vtl->current_tp_track ) vik_track_calculate_bounds ( vtl->current_tp_track ); - if ( vtl->tpwin ) + if ( vtl->tpwin ) if ( vtl->current_tp_track ) vik_trw_layer_tpwin_set_tp ( vtl->tpwin, vtl->current_tpl, vtl->current_tp_track->name ); + // NB don't reset the selected trackpoint, thus ensuring it's still in the tpwin } } - // Reset - vtl->current_wp = NULL; - vtl->current_wp_id = NULL; - trw_layer_cancel_current_tp ( vtl, FALSE ); - vik_layer_emit_update ( VIK_LAYER(vtl) ); return TRUE; }