Fix plotting of 360 degree arcs and printing of mirrored arcs.
The second issue is OSX-only; the first is universal.
This commit is contained in:
parent
6b12fef288
commit
b0d1e49319
|
@ -314,8 +314,13 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
||||||
}
|
}
|
||||||
else // Mirrored mode: arc orientation is reversed
|
else // Mirrored mode: arc orientation is reversed
|
||||||
{
|
{
|
||||||
|
#ifdef __WXMAC__ // wxWidgets OSX print driver handles arc mirroring for us
|
||||||
|
if( StAngle > EndAngle )
|
||||||
|
std::swap( StAngle, EndAngle );
|
||||||
|
#else
|
||||||
if( StAngle < EndAngle )
|
if( StAngle < EndAngle )
|
||||||
std::swap( StAngle, EndAngle );
|
std::swap( StAngle, EndAngle );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if( filled )
|
if( filled )
|
||||||
|
|
|
@ -515,7 +515,11 @@ void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
||||||
double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
|
double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
|
||||||
double endAngle = startAngle + aEdge->GetAngle();
|
double endAngle = startAngle + aEdge->GetAngle();
|
||||||
|
|
||||||
m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
|
||||||
|
if( std::abs( aEdge->GetAngle() ) == 3600.0 )
|
||||||
|
m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
|
else
|
||||||
|
m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -752,7 +756,12 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg )
|
||||||
radius = KiROUND( GetLineLength( end, start ) );
|
radius = KiROUND( GetLineLength( end, start ) );
|
||||||
StAngle = ArcTangente( end.y - start.y, end.x - start.x );
|
StAngle = ArcTangente( end.y - start.y, end.x - start.x );
|
||||||
EndAngle = StAngle + aSeg->GetAngle();
|
EndAngle = StAngle + aSeg->GetAngle();
|
||||||
m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
|
||||||
|
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
|
||||||
|
if( std::abs( aSeg->GetAngle() ) == 3600.0 )
|
||||||
|
m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
|
else
|
||||||
|
m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_CURVE:
|
case S_CURVE:
|
||||||
|
|
Loading…
Reference in New Issue