Fix incorrect Rotate() functions for shapes circles and arcs.
VECTOR2I::Rotate( double aAngle ) returns a rotated point, but does change the object itself. Fixes #4810 https://gitlab.com/kicad/code/kicad/issues/4810
This commit is contained in:
parent
0d8c6d43a8
commit
5d5706b8be
|
@ -106,7 +106,9 @@ public:
|
||||||
|
|
||||||
void Rotate( double aAngle, const VECTOR2I& aCenter = { 0, 0 } ) override
|
void Rotate( double aAngle, const VECTOR2I& aCenter = { 0, 0 } ) override
|
||||||
{
|
{
|
||||||
// That was easy....
|
m_center -= aCenter;
|
||||||
|
m_center = m_center.Rotate( aAngle );
|
||||||
|
m_center += aCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSolid() const override
|
bool IsSolid() const override
|
||||||
|
|
|
@ -279,13 +279,14 @@ void SHAPE_ARC::Rotate( double aAngle, const VECTOR2I& aCenter )
|
||||||
m_end -= aCenter;
|
m_end -= aCenter;
|
||||||
m_mid -= aCenter;
|
m_mid -= aCenter;
|
||||||
|
|
||||||
m_start.Rotate( aAngle );
|
m_start = m_start.Rotate( aAngle );
|
||||||
m_end.Rotate( aAngle );
|
m_end = m_end.Rotate( aAngle );
|
||||||
m_mid.Rotate( aAngle );
|
m_mid = m_mid.Rotate( aAngle );
|
||||||
|
|
||||||
m_start += aCenter;
|
m_start += aCenter;
|
||||||
m_end += aCenter;
|
m_end += aCenter;
|
||||||
m_mid += aCenter;
|
m_mid += aCenter;
|
||||||
|
|
||||||
update_bbox();
|
update_bbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue