Fix some issues with group bounding boxes.

Fixes https://gitlab.com/kicad/code/kicad/issues/12958
This commit is contained in:
Jeff Young 2022-11-20 23:57:18 +00:00
parent 0120df014e
commit c1510f07d8
2 changed files with 17 additions and 0 deletions

View File

@ -517,6 +517,7 @@ void PCB_SELECTION_TOOL::EnterGroup()
select( titem ); select( titem );
} ); } );
view()->Hide( m_enteredGroup, true );
m_enteredGroupOverlay.Add( m_enteredGroup ); m_enteredGroupOverlay.Add( m_enteredGroup );
view()->Update( &m_enteredGroupOverlay ); view()->Update( &m_enteredGroupOverlay );
} }
@ -529,6 +530,7 @@ void PCB_SELECTION_TOOL::ExitGroup( bool aSelectGroup )
return; return;
m_enteredGroup->ClearFlags( ENTERED ); m_enteredGroup->ClearFlags( ENTERED );
view()->Hide( m_enteredGroup, false );
ClearSelection(); ClearSelection();
if( aSelectGroup ) if( aSelectGroup )

View File

@ -639,8 +639,23 @@ void ZONE::Move( const VECTOR2I& offset )
HatchBorder(); HatchBorder();
/* move fills */
for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList ) for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList )
pair.second->Move( offset ); pair.second->Move( offset );
/*
* move boundingbox cache
*
* While the cache will get nuked at the conclusion of the operation, we use it for some
* things (such as drawing the parent group) during the move.
*/
if( GetBoard() )
{
auto it = GetBoard()->m_ZoneBBoxCache.find( this );
if( it != GetBoard()->m_ZoneBBoxCache.end() )
it->second.Move( offset );
}
} }