Fix backwards arcs in legacy LIB_ARCs.

Fixes https://gitlab.com/kicad/code/kicad/issues/10455
This commit is contained in:
Jeff Young 2022-01-18 13:45:00 +00:00
parent d4ff829c26
commit 8445783216
2 changed files with 5 additions and 9 deletions

View File

@ -508,7 +508,6 @@ void EDA_SHAPE::SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, co
std::swap( m_start, m_end ); std::swap( m_start, m_end );
m_endsSwapped = true; m_endsSwapped = true;
} }
} }
@ -600,8 +599,8 @@ void EDA_SHAPE::ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
const double deg = RAD2DEG( atan2( (double)( GetStart().y - GetEnd().y ), const double deg = RAD2DEG( atan2( (double)( GetStart().y - GetEnd().y ),
(double)( GetEnd().x - GetStart().x ) ) ); (double)( GetEnd().x - GetStart().x ) ) );
aList.emplace_back( _( "Angle" ), wxString::Format( "%.1f", deg ) ); aList.emplace_back( _( "Angle" ), wxString::Format( "%.1f", deg ) );
}
break; break;
}
default: default:
aList.emplace_back( shape, _( "Unrecognized" ) ); aList.emplace_back( shape, _( "Unrecognized" ) );

View File

@ -987,6 +987,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
} }
else if( hasAngles ) else if( hasAngles )
{ {
arc->SetCenter( center );
/** /**
* This accounts for an oddity in the old library format, where the symbol is overdefined. * This accounts for an oddity in the old library format, where the symbol is overdefined.
* The previous draw (based on wxwidgets) used start point and end point and always drew * The previous draw (based on wxwidgets) used start point and end point and always drew
@ -994,13 +995,9 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
* these points were stored in the file, so we need to mimic the swapping of start/end * these points were stored in the file, so we need to mimic the swapping of start/end
* points rather than using the stored angles in order to properly map edge cases. * points rather than using the stored angles in order to properly map edge cases.
*/ */
if( !TRANSFORM().MapAngles( &startAngle, &endAngle ) ) VECTOR2I temp = arc->GetStart();
{ arc->SetStart( arc->GetEnd() );
VECTOR2I temp = arc->GetStart(); arc->SetEnd( temp );
arc->SetStart( arc->GetEnd() );
arc->SetEnd( temp );
}
arc->SetCenter( center );
} }
else else
{ {