Fix ellipse angles when importing DXF.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18121
(cherry picked from commit 044a2305e3
)
Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
This commit is contained in:
parent
590bd6237d
commit
ca18112041
|
@ -642,10 +642,6 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
|
|||
if( startAngle > endAngle )
|
||||
endAngle += ANGLE_360;
|
||||
|
||||
// Angles are relative to major axis
|
||||
startAngle -= EDA_ANGLE( major );
|
||||
endAngle -= EDA_ANGLE( major );
|
||||
|
||||
if( aData.ratio == 1.0 )
|
||||
{
|
||||
double radius = major.EuclideanNorm();
|
||||
|
@ -658,6 +654,10 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
|
|||
}
|
||||
else
|
||||
{
|
||||
// Angles are relative to major axis
|
||||
startAngle -= EDA_ANGLE( major );
|
||||
endAngle -= EDA_ANGLE( major );
|
||||
|
||||
DL_ArcData arc( aData.cx, aData.cy, aData.cz, radius, startAngle.AsDegrees(),
|
||||
endAngle.AsDegrees() );
|
||||
addArc( arc );
|
||||
|
|
Loading…
Reference in New Issue