diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index fb18f67707..a43a43ab5c 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -280,7 +280,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case ID_TRACK_BUTT: if( !IsCopperLayer( GetActiveLayer() ) ) { - DisplayError( this, _( "Tracks on Copper layers only " ) ); + DisplayError( this, _( "Tracks on Copper layers only" ) ); break; } diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 1fced7cdf2..079c740399 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -486,15 +486,20 @@ bool ROUTER_TOOL::onViaCommand( TOOL_EVENT& aEvent, VIATYPE_T aType ) bool ROUTER_TOOL::prepareInteractive() { int routingLayer = getStartLayer( m_startItem ); + + if( !IsCopperLayer( routingLayer ) ) + { + DisplayError( m_frame, _( "Tracks on Copper layers only" ) ); + return false; + } + m_frame->SetActiveLayer( ToLAYER_ID( routingLayer ) ); // fixme: switch on invisible layer // for some reason I don't understand, GetNetclass() may return null sometimes... - if( m_startItem && - m_startItem->Net() >= 0 && - m_startItem->Parent() && - m_startItem->Parent()->GetNetClass() ) + if( m_startItem && m_startItem->Net() >= 0 && + m_startItem->Parent() && m_startItem->Parent()->GetNetClass() ) { highlightNet( true, m_startItem->Net() ); // Update track width and via size shown in main toolbar comboboxes