diff options
Diffstat (limited to 'src/main/java/com/kitfox/svg/pathcmd/Arc.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/pathcmd/Arc.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/main/java/com/kitfox/svg/pathcmd/Arc.java b/src/main/java/com/kitfox/svg/pathcmd/Arc.java index c48d149..cab03f8 100644 --- a/src/main/java/com/kitfox/svg/pathcmd/Arc.java +++ b/src/main/java/com/kitfox/svg/pathcmd/Arc.java @@ -69,12 +69,16 @@ public class Arc extends PathCommand // public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
public void appendPath(GeneralPath path, BuildHistory hist)
{
- float offx = isRelative ? hist.history[0].x : 0f;
- float offy = isRelative ? hist.history[0].y : 0f;
+ float offx = isRelative ? hist.lastPoint.x : 0f;
+ float offy = isRelative ? hist.lastPoint.y : 0f;
- arcTo(path, rx, ry, xAxisRot, largeArc, sweep, x + offx, y + offy, hist.history[0].x, hist.history[0].y);
+ arcTo(path, rx, ry, xAxisRot, largeArc, sweep,
+ x + offx, y + offy,
+ hist.lastPoint.x, hist.lastPoint.y);
// path.lineTo(x + offx, y + offy);
- hist.setPoint(x + offx, y + offy);
+// hist.setPoint(x + offx, y + offy);
+ hist.setLastPoint(x + offx, y + offy);
+ hist.setLastKnot(x + offx, y + offy);
}
public int getNumKnotsAdded()
@@ -242,4 +246,12 @@ public class Arc extends PathCommand return arc;
}
+
+ public String toString()
+ {
+ return "A " + rx + " " + ry
+ + " " + xAxisRot + " " + largeArc
+ + " " + sweep
+ + " " + x + " " + y;
+ }
}
|