Update textvars when the variant changes.

This commit is contained in:
Jeff Young
2026-02-20 18:56:52 +00:00
parent 04859143af
commit 366df7bc32
+17
View File
@@ -536,7 +536,24 @@ void PCB_EDIT_FRAME::onVariantSelected( wxCommandEvent& aEvent )
// Refresh the view and properties panel to show the new variant state
UpdateProperties();
GetCanvas()->GetView()->UpdateAllItemsConditionally(
[&]( KIGFX::VIEW_ITEM* aItem ) -> int
{
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
if( text && text->HasTextVars() )
{
text->ClearRenderCache();
text->ClearBoundingBoxCache();
return KIGFX::GEOMETRY | KIGFX::REPAINT;
}
return 0;
} );
GetCanvas()->Refresh();
Update3DView( true, GetPcbNewSettings()->m_Display.m_Live3DRefresh );
}