Fix proper rounding when generating arcs
We should allow for KiROUND to find the proper end point of the mid/end elements when generating an arc from center/start/angle form
This commit is contained in:
parent
ed7222b1e7
commit
1a7d4f30d9
|
@ -46,11 +46,16 @@ SHAPE_ARC::SHAPE_ARC( const VECTOR2I& aArcCenter, const VECTOR2I& aArcStartPoint
|
||||||
m_width( aWidth )
|
m_width( aWidth )
|
||||||
{
|
{
|
||||||
m_start = aArcStartPoint;
|
m_start = aArcStartPoint;
|
||||||
m_mid = aArcStartPoint;
|
|
||||||
m_end = aArcStartPoint;
|
|
||||||
|
|
||||||
RotatePoint( m_mid, aArcCenter, -aCenterAngle / 2.0 );
|
VECTOR2D mid = aArcStartPoint;
|
||||||
RotatePoint( m_end, aArcCenter, -aCenterAngle );
|
VECTOR2D end = aArcStartPoint;
|
||||||
|
VECTOR2D center = aArcCenter;
|
||||||
|
|
||||||
|
RotatePoint( mid, center, -aCenterAngle / 2.0 );
|
||||||
|
RotatePoint( end, center, -aCenterAngle );
|
||||||
|
|
||||||
|
m_mid = VECTOR2I( KiROUND( mid.x ), KiROUND( mid.y ) );
|
||||||
|
m_end = VECTOR2I( KiROUND( end.x ), KiROUND( end.y ) );
|
||||||
|
|
||||||
update_bbox();
|
update_bbox();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue