Make sure screen RTrees are updated when changing bounding boxes.

This commit is contained in:
Jeff Young 2023-02-07 15:09:24 +00:00
parent 9ce5978c3d
commit 7bc79c17d4
2 changed files with 8 additions and 2 deletions

View File

@ -1479,7 +1479,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler ); Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler );
GetCanvas()->GetView()->UpdateAllItemsConditionally( GetCanvas()->GetView()->UpdateAllItemsConditionally(
[]( KIGFX::VIEW_ITEM* aItem ) -> int [&]( KIGFX::VIEW_ITEM* aItem ) -> int
{ {
int flags = 0; int flags = 0;
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem ); SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem );
@ -1514,6 +1514,9 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
text->ClearBoundingBoxCache(); text->ClearBoundingBoxCache();
flags |= KIGFX::GEOMETRY | KIGFX::REPAINT; flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
} }
if( flags & KIGFX::GEOMETRY )
GetScreen()->Update( item, false ); // Refresh RTree
} }
return flags; return flags;

View File

@ -959,7 +959,7 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
if( dlg.ShowModal() ) if( dlg.ShowModal() )
{ {
getView()->UpdateAllItemsConditionally( getView()->UpdateAllItemsConditionally(
[]( KIGFX::VIEW_ITEM* aItem ) -> int [&]( KIGFX::VIEW_ITEM* aItem ) -> int
{ {
int flags = 0; int flags = 0;
@ -997,6 +997,9 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
text->ClearBoundingBoxCache(); text->ClearBoundingBoxCache();
flags |= KIGFX::GEOMETRY | KIGFX::REPAINT; flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
} }
if( flags & KIGFX::GEOMETRY )
m_frame->GetScreen()->Update( item, false ); // Refresh RTree
} }
return flags; return flags;