- // Initial move...
- // If last point is on curve then move to it, otherwise move to first point...
-
-//NOTE: This is basically doing the below for i=-1.
-// Find some way to integrate this crap.
-/*
-Could do in pairs: get i and i+1, connect them depending on whether the pair
-is a line or a curve.
-4 cases: on to on (line),
- on to off (begin curve),
- off to on (end curve),
- off to off (begin curve)
-*/
-#if 1
- for(int i=0; i<gp->GetNumPoints(poly); i++)
- {
- if (i == 0)
- {
- IPoint pt = (gp->GetOnCurve(poly, 0)
- ? gp->GetPoint(poly, 0) : (gp->GetPrevOnCurve(poly, 0)
- ? gp->GetPrevPoint(poly, 0) : gp->GetMidpointToPrev(poly, 0)));
- path->moveTo(pt.x, pt.y);
- }
-
- if (gp->GetOnCurve(poly, i) && gp->GetNextOnCurve(poly, i))
- {
- // Handle lines...
- path->lineTo(gp->GetNextX(poly, i), gp->GetNextY(poly, i));
- }
- else
- {
- // Skip point if it's on curve (start of curve--it's already
- // been plotted so we don't care about it...
- if (gp->GetOnCurve(poly, i))
- i++;
-
- // We may have moved past the end; if not, handle curve
- if (i < gp->GetNumPoints(poly))
- {
- // Handle curves...
- IPoint pt = (gp->GetNextOnCurve(poly, i)
- ? gp->GetNextPoint(poly, i) : gp->GetMidpointToNext(poly, i));
-
- path->quadTo(gp->GetX(poly, i), gp->GetY(poly, i), pt.x, pt.y);
- }
- }
- }
-#else
- IPoint pt;
-
- if (gp->GetPrevOnCurve(poly, 0))
- pt = gp->GetPrevPoint(poly, 0);
+ // If this point and then next are both on curve, we have a line...
+ if (gp->GetOnCurve(poly, i) && gp->GetNextOnCurve(poly, i))
+ path->lineTo(gp->GetNextX(poly, i), gp->GetNextY(poly, i));