Ensure router layer is visible.

Fixes: lp:1663556
* https://bugs.launchpad.net/kicad/+bug/1663556
This commit is contained in:
Jeff Young 2018-03-16 02:42:38 +00:00
parent 0a4c04530a
commit 3b0a758f97
5 changed files with 24 additions and 8 deletions

View File

@ -687,6 +687,13 @@ LAYER_NUM LAYER_WIDGET::GetSelectedLayer()
void LAYER_WIDGET::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
{
setLayerCheckbox( aLayer, isVisible );
OnLayerVisible( aLayer, isVisible );
}
void LAYER_WIDGET::setLayerCheckbox( LAYER_NUM aLayer, bool isVisible )
{
int row = findLayerRow( aLayer );
if( row >= 0 )

View File

@ -236,6 +236,8 @@ protected:
void insertRenderRow( int aRow, const ROW& aSpec );
void setLayerCheckbox( LAYER_NUM aLayer, bool isVisible );
/**
* Function passOnFocus
* gives away the keyboard focus up to the main parent window.

View File

@ -623,6 +623,8 @@ public:
*/
virtual void SetActiveLayer( PCB_LAYER_ID aLayer ) override;
PCB_LAYER_WIDGET* GetLayerManager() { return m_Layers; }
/**
* Update the UI to reflect changes to the current layer's transparency.
*/

View File

@ -444,7 +444,7 @@ void PCB_LAYER_WIDGET::SyncLayerVisibilities()
PCB_LAYER_ID layerId = ToLAYER_ID( getDecodedId( w->GetId() ) );
// this does not fire a UI event
SetLayerVisible( layerId, board->IsLayerVisible( layerId ) );
setLayerCheckbox( layerId, board->IsLayerVisible( layerId ) );
}
}
@ -646,16 +646,19 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal
LSET visibleLayers = brd->GetVisibleLayers();
visibleLayers.set( aLayer, isVisible );
if( visibleLayers.test( aLayer ) != isVisible )
{
visibleLayers.set( aLayer, isVisible );
brd->SetVisibleLayers( visibleLayers );
brd->SetVisibleLayers( visibleLayers );
myframe->OnModify();
myframe->OnModify();
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas )
galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
if( galCanvas )
galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
}
if( isFinal )
myframe->GetCanvas()->Refresh();

View File

@ -34,6 +34,7 @@ using namespace std::placeholders;
#include <pcbnew_id.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <pcb_layer_widget.h>
#include <pcb_painter.h>
#include <dialogs/dialog_pns_settings.h>
#include <dialogs/dialog_pns_diff_pair_dimensions.h>
@ -657,7 +658,8 @@ bool ROUTER_TOOL::prepareInteractive()
frame()->SetActiveLayer( ToLAYER_ID( routingLayer ) );
// fixme: switch on invisible layer
// Force layer visible
frame()->GetLayerManager()->SetLayerVisible( routingLayer, true );
// for some reason I don't understand, GetNetclass() may return null sometimes...
if( m_startItem && m_startItem->Net() >= 0 &&