- 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);
- }
- }
+ // Skip point if it's on curve (start of curve--it's already
+ // been plotted so we don't need to handle it...)
+ if (gp->GetOnCurve(poly, i))
+ continue;
+
+ // We are now guaranteed that we are sitting on a curve control
+ // point (off curve). Figure the extent of the curve: If the
+ // following is a curve control point, then use the midpoint to
+ // it otherwise go to the next point since it's on curve.
+ 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);