diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 1c26549869..37ffbf49a5 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -133,9 +133,18 @@ int SCH_EDITOR_CONTROL::PageSetup( const TOOL_EVENT& aEvent ) dlg.SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName ); if( dlg.ShowModal() ) + { + // Update text variables + m_frame->GetCanvas()->GetView()->MarkDirty(); + m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT ); + m_frame->GetCanvas()->Refresh(); + m_frame->OnModify(); + } else + { m_frame->RollbackSchematicFromUndo(); + } return 0; } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index f6b4442ff5..7db353b4c2 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1014,6 +1014,10 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) // Make sure everything's up-to-date GetBoard()->BuildListOfNets(); + PCBNEW_SETTINGS::DISPLAY_OPTIONS* displayOpts = &GetPcbNewSettings()->m_Display; + PCBNEW_SETTINGS::DISPLAY_OPTIONS prevDisplayOpts = *displayOpts; +#define CHANGED( x ) ( displayOpts->x != prevDisplayOpts.x ) + DIALOG_BOARD_SETUP dlg( this ); if( !aInitialPage.IsEmpty() ) @@ -1028,6 +1032,31 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) Kiway().CommonSettingsChanged( false, true ); + GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, + [&]( KIGFX::VIEW_ITEM* aItem ) -> bool + { + if( dynamic_cast( aItem ) ) + { + return CHANGED( m_RatsnestMode ) + || CHANGED( m_ShowGlobalRatsnest ) + || CHANGED( m_DisplayRatsnestLinesCurved ); + } + else if( dynamic_cast( aItem ) ) + { + return CHANGED( m_DisplayPadClearance ); + } + else if( dynamic_cast( aItem ) ) + { + return CHANGED( m_ShowTrackClearanceMode ); + } + else if( dynamic_cast( aItem ) ) + { + return true; // text variables + } + + return false; + } ); + GetCanvas()->Refresh(); UpdateUserInterface(); @@ -1040,6 +1069,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) m_toolManager->ProcessEvent( toolEvent ); } +#undef CHANGED GetCanvas()->SetFocus(); } @@ -1785,14 +1815,6 @@ void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars WX_INFOBAR::MESSAGE_TYPE::DRC_RULES_ERROR ); } - GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, - []( KIGFX::VIEW_ITEM* aItem ) -> bool - { - return dynamic_cast( aItem ) - || dynamic_cast( aItem ) - || dynamic_cast( aItem ); - } ); - GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); GetCanvas()->ForceRefresh(); diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 394ba4957b..8ffe7898de 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -339,9 +339,32 @@ int BOARD_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent ) dlg.SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName ); if( dlg.ShowModal() == wxID_OK ) + { + m_frame->GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, + [&]( KIGFX::VIEW_ITEM* aItem ) -> bool + { + BOARD_ITEM* item = dynamic_cast( aItem ); + + if( !item ) + return false; + + switch( item->Type() ) + { + case PCB_TEXT_T: + case PCB_FP_TEXT_T: + return true; // text variables + + default: + return false; + } + } ); + m_frame->OnModify(); + } else + { m_frame->RollbackFromUndo(); + } return 0; }