Fixes: lp:1635723 (pcbnew: allows sometimes to draw tracks in non copper layers in Gal Mode)

https://bugs.launchpad.net/kicad/+bug/1635723
This commit is contained in:
jean-pierre charras 2016-11-13 19:02:44 +01:00
parent e246a61a72
commit 7051b6d21f
2 changed files with 10 additions and 5 deletions

View File

@ -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;
}

View File

@ -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