From 121ccc3a109928afaee227501b82d0515bd2ed05 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 19 Sep 2020 19:37:58 +0200 Subject: [PATCH] Fix broken MODULE::HitTest() HitTest was using a rotated bounding box, but the bounding box is already right. --- pcbnew/class_module.cpp | 6 +++--- pcbnew/class_module.h | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 5b3588edcd..58e7e24e8b 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -729,7 +729,7 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aSegList, SHAPE_ wxString* aErrorText, unsigned int aTolerance, wxPoint* aErrorLocation = nullptr ); -std::shared_ptr MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const +std::shared_ptr MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const { std::shared_ptr shape ( new SHAPE_NULL ); diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 298a26c4f3..2be930bc97 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -146,11 +146,18 @@ public: /** * Function GetFootprintRect() - * Returns the area of the module footprint excluding any text. + * Build and returns the boundary box of the module footprint excluding any text. * @return EDA_RECT - The rectangle containing the footprint. */ EDA_RECT GetFootprintRect() const; + /** + * Returns the last calculated bounding box of the footprint (does not recalculate it). + * (call CalculateBoundingBox() to recalculate it) + * @return EDA_RECT - The rectangle containing the footprint + */ + EDA_RECT GetBoundingBoxBase() const { return m_BoundaryBox; } + /** * Returns the bounding box containing pads when the footprint * is on the front side, orientation 0, position 0,0.