Pcbnew: better fix than commit 50d5c6a4

This commit is contained in:
jean-pierre charras 2024-09-28 10:34:54 +02:00
parent b9f11971ad
commit 016b9deec2

View File

@ -2275,16 +2275,11 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
// So using the center of the shape is better (the shape does not move)
if( selection.GetSize() == 1 )
{
EDA_ITEM* item = static_cast<EDA_ITEM*>( selection.GetItem( 0 ) );
PCB_SHAPE* item = dynamic_cast<PCB_SHAPE*>( selection.GetItem( 0 ) );
if( item->IsBOARD_ITEM() )
{
EDA_SHAPE* boardItem = dynamic_cast<EDA_SHAPE*>( item );
if( !boardItem || boardItem->GetShape() != SHAPE_T::RECTANGLE )
if( !item || item->GetShape() != SHAPE_T::RECTANGLE )
refPt = selection.GetReferencePoint();
}
}
const FLIP_DIRECTION flipDirection = frame()->GetPcbNewSettings()->m_FlipDirection;