diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index a7717b8751..61ee1b2ee8 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -1622,19 +1622,11 @@ void FOOTPRINT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) break; case PCB_FP_DIM_ALIGNED_T: - static_cast( item )->Flip( m_pos, false ); - break; - case PCB_FP_DIM_ORTHOGONAL_T: - static_cast( item )->Flip( m_pos, false ); - break; - case PCB_FP_DIM_RADIAL_T: - static_cast( item )->Flip( m_pos, false ); - break; - + case PCB_FP_DIM_CENTER_T: case PCB_FP_DIM_LEADER_T: - static_cast( item )->Flip( m_pos, false ); + static_cast( item )->Flip( m_pos, false ); break; default: @@ -1803,6 +1795,12 @@ void FOOTPRINT::SetOrientation( const EDA_ANGLE& aNewAngle ) for( ZONE* zone : m_fp_zones ) zone->Rotate( GetPosition(), angleChange ); + for( BOARD_ITEM* item : m_drawings ) + { + if( PCB_DIMENSION_BASE* dimension = dynamic_cast( item ) ) + dimension->Rotate( GetPosition(), angleChange ); + } + // Update of the reference and value. m_reference->SetDrawCoord(); m_value->SetDrawCoord(); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index 3601860838..e0b718adb0 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -583,6 +583,14 @@ void PCB_DIM_ALIGNED::SwapData( BOARD_ITEM* aImage ) } +void PCB_DIM_ALIGNED::Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight ) +{ + PCB_DIMENSION_BASE::Mirror( axis_pos, aMirrorLeftRight ); + + m_height = -m_height; +} + + BITMAPS PCB_DIM_ALIGNED::GetMenuImage() const { return BITMAPS::add_aligned_dimension; diff --git a/pcbnew/pcb_dimension.h b/pcbnew/pcb_dimension.h index bc2c45572b..8696f7222f 100644 --- a/pcbnew/pcb_dimension.h +++ b/pcbnew/pcb_dimension.h @@ -233,7 +233,7 @@ public: * * @param axis_pos is the vertical axis position to mirror around. */ - void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false ); + virtual void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false ); void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; @@ -360,6 +360,8 @@ public: virtual void SwapData( BOARD_ITEM* aImage ) override; + void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false ) override; + BITMAPS GetMenuImage() const override; const VECTOR2I& GetCrossbarStart() const { return m_crossBarStart; }