From fb82130530a3ac5069e4dc7b6505f1f4b187e38e Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 29 Jun 2024 11:22:00 -0700 Subject: [PATCH] Fixup cherry-picks for v8 --- eeschema/sch_io/altium/sch_io_altium.cpp | 2 +- libs/kimath/include/geometry/shape_arc.h | 18 +++++++----------- libs/kimath/src/geometry/shape_arc.cpp | 6 ------ qa/qa_utils/mocks.cpp | 6 ++++++ 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/eeschema/sch_io/altium/sch_io_altium.cpp b/eeschema/sch_io/altium/sch_io_altium.cpp index 03a373f6b2..f916e0504b 100644 --- a/eeschema/sch_io/altium/sch_io_altium.cpp +++ b/eeschema/sch_io/altium/sch_io_altium.cpp @@ -2413,7 +2413,7 @@ void SCH_IO_ALTIUM::ParsePieChart( const std::map& aProperti if( aSymbol.empty() && !IsComponentPartVisible( elem ) ) return; - SCH_SHAPE* line = new SCH_SHAPE( SHAPE_T::POLY, LAYER_DEVICE ); + LIB_SHAPE* line = new LIB_SHAPE( symbol, SHAPE_T::POLY ); symbol->AddDrawItem( line, false ); line->SetUnit( std::max( 0, elem.ownerpartid ) ); diff --git a/libs/kimath/include/geometry/shape_arc.h b/libs/kimath/include/geometry/shape_arc.h index bf2a6243d5..094dfe932a 100644 --- a/libs/kimath/include/geometry/shape_arc.h +++ b/libs/kimath/include/geometry/shape_arc.h @@ -149,8 +149,6 @@ public: */ int Intersect( const SHAPE_ARC& aArc, std::vector* aIpsBuffer ) const; - bool IsClockwise() const; - void SetWidth( int aWidth ) { m_width = aWidth; @@ -249,15 +247,6 @@ public: void TransformToPolygon( SHAPE_POLY_SET& aBuffer, int aError, ERROR_LOC aErrorLoc ) const override; -private: - bool ccw( const VECTOR2I& aA, const VECTOR2I& aB, const VECTOR2I& aC ) const - { - return ( ecoord{ aC.y } - aA.y ) * ( ecoord{ aB.x } - aA.x ) > - ( ecoord{ aB.y } - aA.y ) * ( ecoord{ aC.x } - aA.x ); - } - - void update_bbox(); - /** * @return true if the arc is counter-clockwise. */ @@ -276,6 +265,13 @@ private: bool IsClockwise() const { return !IsCCW(); } private: + bool ccw( const VECTOR2I& aA, const VECTOR2I& aB, const VECTOR2I& aC ) const + { + return ( ecoord{ aC.y } - aA.y ) * ( ecoord{ aB.x } - aA.x ) > + ( ecoord{ aB.y } - aA.y ) * ( ecoord{ aC.x } - aA.x ); + } + + void update_bbox(); bool sliceContainsPoint( const VECTOR2I& p ) const; diff --git a/libs/kimath/src/geometry/shape_arc.cpp b/libs/kimath/src/geometry/shape_arc.cpp index c6c9e44611..f033c59900 100644 --- a/libs/kimath/src/geometry/shape_arc.cpp +++ b/libs/kimath/src/geometry/shape_arc.cpp @@ -372,12 +372,6 @@ const BOX2I SHAPE_ARC::BBox( int aClearance ) const } -bool SHAPE_ARC::IsClockwise() const -{ - return GetCentralAngle() < ANGLE_0; -} - - VECTOR2I SHAPE_ARC::NearestPoint( const VECTOR2I& aP ) const { const static int s_epsilon = 8; diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index 555e05d287..b7136c6abd 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -514,6 +514,12 @@ PCB_SELECTION& PCB_TOOL_BASE::selection() } +BOX2I PCB_SELECTION::GetBoundingBox( bool aOnlyVisible ) const +{ + return BOX2I(); +} + + EDA_ITEM* PCB_SELECTION::GetTopLeftItem( bool onlyModules ) const { return nullptr;