Commit 645e1768 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Pull unfilled polygon drawing thru the line clipper; GTK mess up even in this...

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.
parent 6d17ad71
...@@ -805,15 +805,11 @@ static void GRSPoly( EDA_RECT* ClipBox, wxDC* DC, int n, wxPoint Points[], ...@@ -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, ...@@ -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 );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment