Fix printing of LIB_SHAPE arcs.
This commit is contained in:
parent
20328ab331
commit
7760d3275d
|
@ -638,6 +638,38 @@ void GRArc1( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aStart, const wxPoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GRFilledArc1( EDA_RECT* ClipBox, wxDC* DC, const wxPoint& aStart, const wxPoint& aEnd,
|
||||||
|
const wxPoint& aCenter, int width, const COLOR4D& Color, const COLOR4D& BgColor )
|
||||||
|
{
|
||||||
|
/* Clip arcs off screen. */
|
||||||
|
if( ClipBox )
|
||||||
|
{
|
||||||
|
int x0, y0, xm, ym, r;
|
||||||
|
x0 = ClipBox->GetX();
|
||||||
|
y0 = ClipBox->GetY();
|
||||||
|
xm = ClipBox->GetRight();
|
||||||
|
ym = ClipBox->GetBottom();
|
||||||
|
r = KiROUND( Distance( aStart.x, aStart.y, aCenter.x, aCenter.y ) );
|
||||||
|
|
||||||
|
if( aCenter.x < ( x0 - r ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( aCenter.y < ( y0 - r ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( aCenter.x > ( r + xm ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( aCenter.y > ( r + ym ) )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GRSetBrush( DC, BgColor, FILLED );
|
||||||
|
GRSetColorPen( DC, Color, width );
|
||||||
|
DC->DrawArc( aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle, double EndAngle,
|
void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle, double EndAngle,
|
||||||
int r, int width, const COLOR4D& Color, const COLOR4D& BgColor )
|
int r, int width, const COLOR4D& Color, const COLOR4D& BgColor )
|
||||||
{
|
{
|
||||||
|
|
|
@ -270,7 +270,7 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
switch( GetShape() )
|
switch( GetShape() )
|
||||||
{
|
{
|
||||||
case SHAPE_T::ARC:
|
case SHAPE_T::ARC:
|
||||||
GRArc1( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, c.x, c.y, penWidth, color );
|
GRArc1( nullptr, DC, pt1, pt2, c, penWidth, color );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHAPE_T::CIRCLE:
|
case SHAPE_T::CIRCLE:
|
||||||
|
@ -304,9 +304,9 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
// If we stroke in GRFilledArc it will stroke the two radials too, so we have to
|
// If we stroke in GRFilledArc it will stroke the two radials too, so we have to
|
||||||
// fill and stroke separately
|
// fill and stroke separately
|
||||||
|
|
||||||
GRFilledArc( nullptr, DC, c.x, c.y, -t2, -t1, GetRadius(), 0, fillColor, fillColor );
|
GRFilledArc1( nullptr, DC, pt1, pt2, c, penWidth, fillColor, fillColor );
|
||||||
|
|
||||||
GRArc1( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, c.x, c.y, penWidth, color );
|
GRArc1( nullptr, DC, pt1, pt2, c, penWidth, color );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHAPE_T::CIRCLE:
|
case SHAPE_T::CIRCLE:
|
||||||
|
|
|
@ -190,6 +190,8 @@ void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle, dou
|
||||||
int r, const COLOR4D& Color, const COLOR4D& BgColor );
|
int r, const COLOR4D& Color, const COLOR4D& BgColor );
|
||||||
void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle,
|
void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle,
|
||||||
double EndAngle, int r, int width, const COLOR4D& Color, const COLOR4D& BgColor );
|
double EndAngle, int r, int width, const COLOR4D& Color, const COLOR4D& BgColor );
|
||||||
|
void GRFilledArc1( EDA_RECT* ClipBox, wxDC* DC, const wxPoint& aStart, const wxPoint& aEnd,
|
||||||
|
const wxPoint& aCenter, int width, const COLOR4D& Color, const COLOR4D& BgColor );
|
||||||
void GRCSegm( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width,
|
void GRCSegm( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width,
|
||||||
const COLOR4D& Color );
|
const COLOR4D& Color );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue