7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 13:30:11 +00:00

SynchronizeProperties after (potentially) changing text vars.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19658
This commit is contained in:
Jeff Young 2025-01-16 18:18:38 +00:00
parent 6eaeacfe79
commit 0d6a2f1c47
2 changed files with 19 additions and 6 deletions

View File

@ -946,6 +946,9 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
settings->LoadDisplayOptions( GetDisplayOptions() );
settings->m_ForceShowFieldsWhenFPSelected = GetPcbNewSettings()->m_Display.m_ForceShowFieldsWhenFPSelected;
if( aTextVarsChanged )
GetBoard()->SynchronizeProperties();
// Note: KIGFX::REPAINT isn't enough for things that go from invisible to visible as
// they won't be found in the view layer's itemset for re-painting.
GetCanvas()->GetView()->UpdateAllItemsConditionally(
@ -963,6 +966,15 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
{
return KIGFX::REPAINT; // pad clearance display
}
else if( EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem ) )
{
if( text->HasTextVars() )
{
text->ClearRenderCache();
text->ClearBoundingBoxCache();
return KIGFX::GEOMETRY | KIGFX::REPAINT;
}
}
return 0;
} );

View File

@ -1387,13 +1387,14 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
flags |= KIGFX::REPAINT;
}
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
if( text && text->HasTextVars() )
if( EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem ) )
{
text->ClearRenderCache();
text->ClearBoundingBoxCache();
flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
if( text->HasTextVars() )
{
text->ClearRenderCache();
text->ClearBoundingBoxCache();
flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
}
}
return flags;