Only update items that can be affected

When updating the view, don't force repaint all items.  Changing the
line width only affects elements with lines

Fixes https://gitlab.com/kicad/code/kicad/issues/13579
This commit is contained in:
Seth Hillbrand 2023-01-18 09:58:02 -08:00
parent 098b03e17a
commit 7fa15b3fbb
1 changed files with 20 additions and 2 deletions

View File

@ -71,8 +71,26 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
view->GetPainter()->GetSettings()->SetDashLengthRatio( settings.GetDashedLineDashRatio() );
view->GetPainter()->GetSettings()->SetGapLengthRatio( settings.GetDashedLineGapRatio() );
view->MarkDirty();
view->UpdateAllItems( KIGFX::REPAINT );
view->UpdateAllItemsConditionally( KIGFX::REPAINT, [] ( KIGFX::VIEW_ITEM* aItem ) -> bool
{
EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
if( !item )
return false;
switch( item->Type() )
{
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
return true;
default:
return false;
}
} );
m_frame->GetCanvas()->Refresh();
return true;