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:
Maciej Suminski
2017-05-16 17:58:09 +02:00
parent f77db7b4b9
commit e79f97860c
6 changed files with 158 additions and 167 deletions
+12 -4
View File
@@ -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 );
}