Pull unfilled polygon drawing thru the line clipper; GTK mess up even in this case and the sheet border lines glitch on the screen at high zoom otherwise in pcbnew.

This commit is contained in:
Lorenzo Marcantonio 2014-05-16 19:43:27 +02:00
parent 6d17ad712c
commit 645e17684d
1 changed files with 13 additions and 15 deletions

View File

@ -805,15 +805,11 @@ static void GRSPoly( EDA_RECT* ClipBox, wxDC* DC, int n, wxPoint Points[],
} }
else else
{ {
wxPoint endPt = Points[n - 1]; GRMoveTo( Points[0].x, Points[0].y );
for( int i = 1; i < n; ++i )
GRSetBrush( DC, Color ); {
DC->DrawLines( n, Points ); GRLineTo( ClipBox, DC, Points[i].x, Points[i].y, width, Color );
}
// The last point is not drawn by DrawLine and DrawLines
// Add it if the polygon is not closed
if( endPt != Points[0] )
DC->DrawPoint( endPt.x, endPt.y );
} }
} }
@ -841,16 +837,18 @@ static void GRSClosedPoly( EDA_RECT* aClipBox, wxDC* aDC,
} }
else else
{ {
GRSetBrush( aDC, aBgColor ); GRMoveTo( aPoints[0].x, aPoints[0].y );
aDC->DrawLines( aPointCount, aPoints ); for( int i = 1; i < aPointCount; ++i )
{
GRLineTo( aClipBox, aDC, aPoints[i].x, aPoints[i].y, aWidth, aColor );
}
int lastpt = aPointCount - 1; int lastpt = aPointCount - 1;
/* Close the polygon. */
// Close the polygon
if( aPoints[lastpt] != aPoints[0] ) if( aPoints[lastpt] != aPoints[0] )
{ {
GRLine( aClipBox, aDC, aPoints[0].x, aPoints[0].y, GRLineTo( aClipBox, aDC, aPoints[lastpt].x, aPoints[lastpt].y, aWidth, aColor );
aPoints[lastpt].x, aPoints[lastpt].y,
aWidth, aColor );
} }
} }
} }