Ensure router layer is visible.
Fixes: lp:1663556 * https://bugs.launchpad.net/kicad/+bug/1663556
This commit is contained in:
parent
0a4c04530a
commit
3b0a758f97
|
@ -687,6 +687,13 @@ LAYER_NUM LAYER_WIDGET::GetSelectedLayer()
|
||||||
|
|
||||||
|
|
||||||
void LAYER_WIDGET::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
|
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 );
|
int row = findLayerRow( aLayer );
|
||||||
if( row >= 0 )
|
if( row >= 0 )
|
||||||
|
|
|
@ -236,6 +236,8 @@ protected:
|
||||||
|
|
||||||
void insertRenderRow( int aRow, const ROW& aSpec );
|
void insertRenderRow( int aRow, const ROW& aSpec );
|
||||||
|
|
||||||
|
void setLayerCheckbox( LAYER_NUM aLayer, bool isVisible );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function passOnFocus
|
* Function passOnFocus
|
||||||
* gives away the keyboard focus up to the main parent window.
|
* gives away the keyboard focus up to the main parent window.
|
||||||
|
|
|
@ -623,6 +623,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void SetActiveLayer( PCB_LAYER_ID aLayer ) override;
|
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.
|
* Update the UI to reflect changes to the current layer's transparency.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -444,7 +444,7 @@ void PCB_LAYER_WIDGET::SyncLayerVisibilities()
|
||||||
PCB_LAYER_ID layerId = ToLAYER_ID( getDecodedId( w->GetId() ) );
|
PCB_LAYER_ID layerId = ToLAYER_ID( getDecodedId( w->GetId() ) );
|
||||||
|
|
||||||
// this does not fire a UI event
|
// 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();
|
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 )
|
if( galCanvas )
|
||||||
galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
|
galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
|
||||||
|
}
|
||||||
|
|
||||||
if( isFinal )
|
if( isFinal )
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
|
|
|
@ -34,6 +34,7 @@ using namespace std::placeholders;
|
||||||
#include <pcbnew_id.h>
|
#include <pcbnew_id.h>
|
||||||
#include <view/view.h>
|
#include <view/view.h>
|
||||||
#include <view/view_controls.h>
|
#include <view/view_controls.h>
|
||||||
|
#include <pcb_layer_widget.h>
|
||||||
#include <pcb_painter.h>
|
#include <pcb_painter.h>
|
||||||
#include <dialogs/dialog_pns_settings.h>
|
#include <dialogs/dialog_pns_settings.h>
|
||||||
#include <dialogs/dialog_pns_diff_pair_dimensions.h>
|
#include <dialogs/dialog_pns_diff_pair_dimensions.h>
|
||||||
|
@ -657,7 +658,8 @@ bool ROUTER_TOOL::prepareInteractive()
|
||||||
|
|
||||||
frame()->SetActiveLayer( ToLAYER_ID( routingLayer ) );
|
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...
|
// for some reason I don't understand, GetNetclass() may return null sometimes...
|
||||||
if( m_startItem && m_startItem->Net() >= 0 &&
|
if( m_startItem && m_startItem->Net() >= 0 &&
|
||||||
|
|
Loading…
Reference in New Issue