From 95d3336f634ddfb6e8389376acf3b5ad3d651e40 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 26 Jul 2018 23:35:11 +0100 Subject: [PATCH] We need the other end of the stick when not yet routing. Fixes: lp:1781424 * https://bugs.launchpad.net/kicad/+bug/1781424 --- pcbnew/router/pns_tool_base.cpp | 2 +- pcbnew/router/pns_tool_base.h | 2 +- pcbnew/router/router_tool.cpp | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 2780b113df..18a222ea2a 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -248,7 +248,7 @@ bool TOOL_BASE::checkSnap( ITEM *aItem ) return doSnap; } -void TOOL_BASE::updateStartItem( TOOL_EVENT& aEvent, bool aIgnorePads ) +void TOOL_BASE::updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads ) { int tl = getView()->GetTopLayer(); VECTOR2I cp = controls()->GetCursorPosition(); diff --git a/pcbnew/router/pns_tool_base.h b/pcbnew/router/pns_tool_base.h index 8e8caf14eb..e3bc22b4c1 100644 --- a/pcbnew/router/pns_tool_base.h +++ b/pcbnew/router/pns_tool_base.h @@ -57,7 +57,7 @@ protected: virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1, bool aIgnorePads = false ); virtual void highlightNet( bool aEnabled, int aNetcode = -1 ); - virtual void updateStartItem( TOOL_EVENT& aEvent, bool aIgnorePads = false ); + virtual void updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads = false ); virtual void updateEndItem( const TOOL_EVENT& aEvent ); void deleteTraces( ITEM* aStartItem, bool aWholeTrack ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 9cc2a51b30..3675887993 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -706,7 +706,10 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent ) m_router->UpdateSizes( sizes ); m_router->ToggleViaPlacement(); - updateEndItem( aEvent ); + if( m_router->RoutingInProgress() ) + updateEndItem( aEvent ); + else + updateStartItem( aEvent ); m_router->Move( m_endSnapPoint, m_endItem ); // refresh