Browse Source

Don't rebuild the whole nets grid on show/hide

Besides being slow, this causes the scroll position
of the grid to be lost.
6.0.7
Jon Evans 5 years ago
parent
commit
34c2bbfe51
  1. 2
      pcbnew/tools/board_inspection_tool.cpp
  2. 12
      pcbnew/widgets/appearance_controls.cpp
  3. 3
      pcbnew/widgets/appearance_controls.h

2
pcbnew/tools/board_inspection_tool.cpp

@ -1242,7 +1242,7 @@ void BOARD_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide )
m_frame->GetCanvas()->RedrawRatsnest();
m_frame->GetCanvas()->Refresh();
m_frame->GetAppearancePanel()->OnBoardNetSettingsChanged( *m_frame->GetBoard() );
m_frame->GetAppearancePanel()->OnNetVisibilityChanged( aNetCode, !aHide );
}

12
pcbnew/widgets/appearance_controls.cpp

@ -948,6 +948,18 @@ void APPEARANCE_CONTROLS::OnBoardNetSettingsChanged( BOARD& aBoard )
}
void APPEARANCE_CONTROLS::OnNetVisibilityChanged( int aNetCode, bool aVisibility )
{
int row = m_netsTable->GetRowByNetcode( aNetCode );
if( row >= 0 )
{
m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aVisibility );
m_netsGrid->ForceRefresh();
}
}
bool APPEARANCE_CONTROLS::doesBoardItemNeedRebuild( BOARD_ITEM* aBoardItem )
{
return aBoardItem->Type() == PCB_NETINFO_T;

3
pcbnew/widgets/appearance_controls.h

@ -224,6 +224,9 @@ public:
///< Update the widget when the active board layer is changed.
void OnLayerChanged();
/// Notifies the panel when a net has been hidden or shown via the external tool.
void OnNetVisibilityChanged( int aNetCode, bool aVisibility );
///< Manually update visibility for a given layer
void SetLayerVisible( LAYER_NUM aLayer, bool isVisible );

Loading…
Cancel
Save