From a82edb60fe65aa5731a0fa7ed7a7029adb9138ed Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 16 Sep 2020 18:45:08 -0400 Subject: [PATCH] Rotate the bounding box for hit tests on the fly --- common/base_struct.cpp | 2 +- include/eda_rect.h | 2 +- pcbnew/class_module.cpp | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/base_struct.cpp b/common/base_struct.cpp index 6b31e8efeb..153f3ab999 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -737,7 +737,7 @@ EDA_RECT EDA_RECT::Common( const EDA_RECT& aRect ) const } -const EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ) +const EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ) const { wxPoint corners[4]; diff --git a/include/eda_rect.h b/include/eda_rect.h index b49a4386fb..0508db41db 100644 --- a/include/eda_rect.h +++ b/include/eda_rect.h @@ -360,7 +360,7 @@ public: * useful to calculate bounding box of rotated items, when * rotation if not k*90 degrees */ - const EDA_RECT GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ); + const EDA_RECT GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ) const; }; diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 4c3852c017..41b8331eaf 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -719,7 +719,7 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector( item )->SetDrawCoord(); } } - - m_BoundaryBox = m_BoundaryBox.GetBoundingBoxRotated( GetPosition(), angleChange ); }