SHAPE_ARC::GetCentralAngle(): ensure a 360 deg arc angle is always returned as 360 deg.
An arc having the same start and end points can be 0 or 360 deg arc. In Kicad it is always 360 deg arc (i.e. a circle) Fixes #13182 https://gitlab.com/kicad/code/kicad/issues/13182
This commit is contained in:
parent
ec1d81a012
commit
1047e7143a
|
@ -447,6 +447,12 @@ double SHAPE_ARC::GetLength() const
|
|||
|
||||
EDA_ANGLE SHAPE_ARC::GetCentralAngle() const
|
||||
{
|
||||
// Arcs with same start and end points can be 0 deg or 360 deg arcs.
|
||||
// However, they are expected to be circles.
|
||||
// So return 360 degrees as central arc:
|
||||
if( m_start == m_end )
|
||||
return ANGLE_360;
|
||||
|
||||
VECTOR2I center = GetCenter();
|
||||
EDA_ANGLE angle1 = EDA_ANGLE( m_mid - center ) - EDA_ANGLE( m_start - center );
|
||||
EDA_ANGLE angle2 = EDA_ANGLE( m_end - center ) - EDA_ANGLE( m_mid - center );
|
||||
|
|
Loading…
Reference in New Issue