diff --git a/libs/kimath/src/geometry/shape_poly_set.cpp b/libs/kimath/src/geometry/shape_poly_set.cpp index 6e51a0cf6b..2567bfe871 100644 --- a/libs/kimath/src/geometry/shape_poly_set.cpp +++ b/libs/kimath/src/geometry/shape_poly_set.cpp @@ -1552,6 +1552,8 @@ void SHAPE_POLY_SET::Rotate( double aAngle, const VECTOR2I& aCenter ) for( SHAPE_LINE_CHAIN& path : poly ) path.Rotate( aAngle, aCenter ); } + + CacheTriangulation(); } diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 99868e6aee..ac7e8c9855 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -198,13 +198,13 @@ bool ZONE_CONTAINER::UnFill() { bool change = false; - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) { change |= !pair.second.IsEmpty(); pair.second.RemoveAllContours(); } - for( std::pair pair : m_FillSegmList ) + for( std::pair& pair : m_FillSegmList ) { change |= !pair.second.empty(); pair.second.clear(); @@ -721,10 +721,10 @@ void ZONE_CONTAINER::Move( const wxPoint& offset ) Hatch(); - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) pair.second.Move( offset ); - for( std::pair pair : m_FillSegmList ) + for( std::pair& pair : m_FillSegmList ) { for( SEG& seg : pair.second ) { @@ -760,10 +760,10 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, double angle ) Hatch(); /* rotate filled areas: */ - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) pair.second.Rotate( angle, VECTOR2I( centre ) ); - for( std::pair pair : m_FillSegmList ) + for( std::pair& pair : m_FillSegmList ) { for( SEG& seg : pair.second ) { @@ -797,10 +797,10 @@ void ZONE_CONTAINER::Mirror( const wxPoint& aMirrorRef, bool aMirrorLeftRight ) Hatch(); - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) pair.second.Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) ); - for( std::pair pair : m_FillSegmList ) + for( std::pair& pair : m_FillSegmList ) { for( SEG& seg : pair.second ) { @@ -1146,7 +1146,7 @@ void ZONE_CONTAINER::SwapData( BOARD_ITEM* aImage ) void ZONE_CONTAINER::CacheTriangulation() { - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) pair.second.CacheTriangulation(); } @@ -1255,7 +1255,7 @@ double ZONE_CONTAINER::CalculateFilledArea() // Iterate over each outline polygon in the zone and then iterate over // each hole it has to compute the total area. - for( std::pair pair : m_FilledPolysList ) + for( std::pair& pair : m_FilledPolysList ) { SHAPE_POLY_SET& poly = pair.second;