Cross-probing: Do not center/zoom on empty BBox

This commit is contained in:
Alex 2022-01-31 10:17:59 +03:00
parent 419010ec46
commit e9ffea83fd
1 changed files with 7 additions and 4 deletions

View File

@ -1575,6 +1575,8 @@ void PCB_SELECTION_TOOL::doSyncSelection( const std::vector<BOARD_ITEM*>& aItems
EDA_RECT bbox = m_selection.GetBoundingBox(); EDA_RECT bbox = m_selection.GetBoundingBox();
if( bbox.GetWidth() > 0 && bbox.GetHeight() > 0 )
{
if( m_frame->Settings().m_CrossProbing.center_on_items ) if( m_frame->Settings().m_CrossProbing.center_on_items )
{ {
if( m_frame->Settings().m_CrossProbing.zoom_to_fit ) if( m_frame->Settings().m_CrossProbing.zoom_to_fit )
@ -1582,6 +1584,7 @@ void PCB_SELECTION_TOOL::doSyncSelection( const std::vector<BOARD_ITEM*>& aItems
m_frame->FocusOnLocation( bbox.Centre() ); m_frame->FocusOnLocation( bbox.Centre() );
} }
}
view()->UpdateAllLayersColor(); view()->UpdateAllLayersColor();