Fix repaints getting done after the wrong dialog.
(cherry picked from commit b7c9a1ad55
)
This commit is contained in:
parent
fd4ac7c5df
commit
f37531ed39
|
@ -58,6 +58,7 @@
|
|||
#include <tool/grid_menu.h>
|
||||
#include "cleanup_item.h"
|
||||
#include <zoom_defines.h>
|
||||
#include <ratsnest/ratsnest_view_item.h>
|
||||
|
||||
|
||||
wxDEFINE_EVENT( BOARD_CHANGED, wxCommandEvent );
|
||||
|
@ -810,7 +811,25 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
|
|||
EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
|
||||
GetCanvas()->GetView()->GetPainter()->GetSettings()->LoadColors( GetColorSettings() );
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
|
||||
|
||||
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
|
||||
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool
|
||||
{
|
||||
if( dynamic_cast<RATSNEST_VIEW_ITEM*>( aItem ) )
|
||||
{
|
||||
return true; // ratsnest display
|
||||
}
|
||||
else if( dynamic_cast<PCB_TRACK*>( aItem ) )
|
||||
{
|
||||
return true; // track, arc & via clearance display
|
||||
}
|
||||
else if( dynamic_cast<PAD*>( aItem ) )
|
||||
{
|
||||
return true; // pad clearance display
|
||||
}
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
RecreateToolbars();
|
||||
|
||||
|
|
|
@ -973,8 +973,6 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
|
|||
// Make sure everything's up-to-date
|
||||
GetBoard()->BuildListOfNets();
|
||||
|
||||
const PCB_DISPLAY_OPTIONS prevOpts = GetDisplayOptions();
|
||||
|
||||
DIALOG_BOARD_SETUP dlg( this );
|
||||
|
||||
if( !aInitialPage.IsEmpty() )
|
||||
|
@ -989,36 +987,13 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
|
|||
|
||||
Kiway().CommonSettingsChanged( false, true );
|
||||
|
||||
bool trackClearanceModeChanged = GetDisplayOptions().m_ShowTrackClearanceMode
|
||||
!= prevOpts.m_ShowTrackClearanceMode;
|
||||
bool padClearanceModeChanged = GetDisplayOptions().m_DisplayPadClearance
|
||||
!= prevOpts.m_DisplayPadClearance;
|
||||
|
||||
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
|
||||
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool
|
||||
{
|
||||
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
|
||||
if( dynamic_cast<EDA_TEXT*>( aItem ) )
|
||||
return true; // text variables
|
||||
|
||||
if( !item )
|
||||
return false;
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_TRACE_T:
|
||||
case PCB_ARC_T:
|
||||
case PCB_VIA_T:
|
||||
return trackClearanceModeChanged;
|
||||
|
||||
case PCB_PAD_T:
|
||||
return padClearanceModeChanged;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
case PCB_FP_TEXT_T:
|
||||
return true; // text variables
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
} );
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
|
|
Loading…
Reference in New Issue