Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only once, at other times they were just straight lines or crashed the application.
This commit is contained in:
+12
-4
@@ -1233,8 +1233,12 @@ void GRBezier( EDA_RECT* ClipBox,
|
||||
int width,
|
||||
COLOR4D Color )
|
||||
{
|
||||
std::vector<wxPoint> Points = Bezier2Poly( x1, y1, x2, y2, x3, y3 );
|
||||
GRPoly( ClipBox, DC, Points.size(), &Points[0], false, width, Color, Color );
|
||||
std::vector<wxPoint> points;
|
||||
|
||||
BEZIER_POLY converter( x1, y1, x2, y2, x3, y3 );
|
||||
converter.GetPoly( points );
|
||||
|
||||
GRPoly( ClipBox, DC, points.size(), &points[0], false, width, Color, Color );
|
||||
}
|
||||
|
||||
|
||||
@@ -1251,8 +1255,12 @@ void GRBezier( EDA_RECT* ClipBox,
|
||||
int width,
|
||||
COLOR4D Color )
|
||||
{
|
||||
std::vector<wxPoint> Points = Bezier2Poly( x1, y1, x2, y2, x3, y3, x4, y4 );
|
||||
GRPoly( ClipBox, DC, Points.size(), &Points[0], false, width, Color, Color );
|
||||
std::vector<wxPoint> points;
|
||||
|
||||
BEZIER_POLY converter( x1, y1, x2, y2, x3, y3, x4, y4 );
|
||||
converter.GetPoly( points );
|
||||
|
||||
GRPoly( ClipBox, DC, points.size(), &points[0], false, width, Color, Color );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user