diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 87b281c603..3611a6ffd6 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -58,6 +58,7 @@ #include #include "cleanup_item.h" #include +#include 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( aItem ) ) + { + return true; // ratsnest display + } + else if( dynamic_cast( aItem ) ) + { + return true; // track, arc & via clearance display + } + else if( dynamic_cast( aItem ) ) + { + return true; // pad clearance display + } + + return false; + } ); RecreateToolbars(); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index a7d083321f..0b1cfa8e73 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -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( aItem ); + if( dynamic_cast( 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();