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,12 +1575,15 @@ void PCB_SELECTION_TOOL::doSyncSelection( const std::vector<BOARD_ITEM*>& aItems
EDA_RECT bbox = m_selection.GetBoundingBox();
if( m_frame->Settings().m_CrossProbing.center_on_items )
if( bbox.GetWidth() > 0 && bbox.GetHeight() > 0 )
{
if( m_frame->Settings().m_CrossProbing.zoom_to_fit )
zoomFitCrossProbeBBox( bbox );
if( m_frame->Settings().m_CrossProbing.center_on_items )
{
if( m_frame->Settings().m_CrossProbing.zoom_to_fit )
zoomFitCrossProbeBBox( bbox );
m_frame->FocusOnLocation( bbox.Centre() );
m_frame->FocusOnLocation( bbox.Centre() );
}
}
view()->UpdateAllLayersColor();