Eeschema: ensure arcs are < 180 deg when creating them.

This commit is contained in:
jean-pierre charras 2022-10-05 11:32:56 +02:00
parent 8e34dae347
commit 92f70a9fa2
1 changed files with 5 additions and 8 deletions

View File

@ -1353,16 +1353,13 @@ void EDA_SHAPE::calcEdit( const VECTOR2I& aPosition )
switch( m_editState ) switch( m_editState )
{ {
case 1: case 1:
{ // Keep arc clockwise while drawing i.e. arc angle = 90 deg.
// Keep center clockwise from chord while drawing // it can be 90 or 270 deg depending on the arc center choice (c1 or c2)
VECTOR2I chordVector = m_end - m_start; m_arcCenter = c1; // first trial
EDA_ANGLE chordAngle( chordVector );
VECTOR2I c1Test = c1; if( GetArcAngle() > ANGLE_180 )
RotatePoint( c1Test, m_start, -chordAngle.Normalize() ); m_arcCenter = c2;
m_arcCenter = c1Test.x > 0 ? c2 : c1;
}
break; break;
case 2: case 2: