Eagle: update RTree after moving schematic
After importing, some schmeatics are moved, item at a time. When moving schematic items, we need to update the RTree bounding box to allow searching on position Fixes #3915 | https://gitlab.com/kicad/code/kicad/issues/3915
This commit is contained in:
parent
d3d74b36bd
commit
62cc733fe6
|
@ -815,10 +815,17 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
|
||||||
m_connPoints.clear();
|
m_connPoints.clear();
|
||||||
|
|
||||||
// Translate the items.
|
// Translate the items.
|
||||||
for( auto item : m_currentSheet->GetScreen()->Items() )
|
std::vector<SCH_ITEM*> allItems;
|
||||||
|
|
||||||
|
std::copy( m_currentSheet->GetScreen()->Items().begin(),
|
||||||
|
m_currentSheet->GetScreen()->Items().end(), std::back_inserter( allItems ) );
|
||||||
|
|
||||||
|
for( auto item : allItems )
|
||||||
{
|
{
|
||||||
item->SetPosition( item->GetPosition() + translation );
|
item->SetPosition( item->GetPosition() + translation );
|
||||||
item->ClearFlags();
|
item->ClearFlags();
|
||||||
|
m_currentSheet->GetScreen()->Update( item );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue