- for(int i=0; i<rotated.GetNumPoints(poly); i++)
- {
- if (rotated.GetOnCurve(poly, i))
- // LineTo(hdc, rotated.GetX(poly, i), rotated.GetY(poly, i));
- {
- p.drawLine(x, y, rotated.GetX(poly, i), rotated.GetY(poly, i));
- x = (int)rotated.GetX(poly, i), y = (int)rotated.GetY(poly, i);
- }
- else
- {
- uint32 prev = rotated.GetPrev(poly, i), next = rotated.GetNext(poly, i);
- float px = rotated.GetX(poly, prev), py = rotated.GetY(poly, prev),
- nx = rotated.GetX(poly, next), ny = rotated.GetY(poly, next);
-
- if (!rotated.GetOnCurve(poly, prev))
- px = (px + rotated.GetX(poly, i)) / 2.0f,
- py = (py + rotated.GetY(poly, i)) / 2.0f;
-
- if (!rotated.GetOnCurve(poly, next))
- nx = (nx + rotated.GetX(poly, i)) / 2.0f,
- ny = (ny + rotated.GetY(poly, i)) / 2.0f;
-
- Bezier(p, point(px, py), point(rotated.GetX(poly, i), rotated.GetY(poly, i)), point(nx, ny));
- x = (int)nx, y = (int)ny;
-
- if (rotated.GetOnCurve(poly, next))
- i++; // Following point is on curve, so move past it
- }
- }