From 2d001796a36967ebd45202fe494dad8a93bd515d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 14 Nov 2020 17:24:27 +0000 Subject: [PATCH] Take into account footprint rotation too. --- pcbnew/fp_shape.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pcbnew/fp_shape.cpp b/pcbnew/fp_shape.cpp index a8c7a3f05b..7ee9619e8c 100644 --- a/pcbnew/fp_shape.cpp +++ b/pcbnew/fp_shape.cpp @@ -51,7 +51,7 @@ FP_SHAPE::~FP_SHAPE() void FP_SHAPE::SetLocalCoord() { - FOOTPRINT* fp = (FOOTPRINT*) m_Parent; + FOOTPRINT* fp = static_cast( m_Parent ); if( fp == NULL ) { @@ -79,7 +79,7 @@ void FP_SHAPE::SetLocalCoord() void FP_SHAPE::SetDrawCoord() { - FOOTPRINT* fp = (FOOTPRINT*) m_Parent; + FOOTPRINT* fp = static_cast( m_Parent ); m_start = m_Start0; m_end = m_End0; @@ -108,10 +108,14 @@ void FP_SHAPE::SetDrawCoord() std::shared_ptr FP_SHAPE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const { + FOOTPRINT* fp = static_cast( m_Parent ); std::vector shapes = MakeEffectiveShapes(); for( SHAPE* shape : shapes ) - shape->Move( m_Parent->GetPosition() ); + { + shape->Rotate( -fp->GetOrientationRadians() ); + shape->Move( fp->GetPosition() ); + } return std::make_shared( shapes ); } @@ -121,7 +125,7 @@ std::shared_ptr FP_SHAPE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const void FP_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; - FOOTPRINT* fp = (FOOTPRINT*) m_Parent; + FOOTPRINT* fp = static_cast( m_Parent ); if( !fp ) return;