diff options
Diffstat (limited to 'src/main/java/com/kitfox/svg/pathcmd/Vertical.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/pathcmd/Vertical.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/kitfox/svg/pathcmd/Vertical.java b/src/main/java/com/kitfox/svg/pathcmd/Vertical.java index ca7bda4..cf7bc4d 100644 --- a/src/main/java/com/kitfox/svg/pathcmd/Vertical.java +++ b/src/main/java/com/kitfox/svg/pathcmd/Vertical.java @@ -42,6 +42,11 @@ public class Vertical extends PathCommand { public Vertical() {
}
+ public String toString()
+ {
+ return "V " + y;
+ }
+
public Vertical(boolean isRelative, float y) {
super(isRelative);
this.y = y;
@@ -50,11 +55,12 @@ public class Vertical extends PathCommand { // public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
public void appendPath(GeneralPath path, BuildHistory hist)
{
- float offx = hist.history[0].x;
- float offy = isRelative ? hist.history[0].y : 0f;
+ float offx = hist.lastPoint.x;
+ float offy = isRelative ? hist.lastPoint.y : 0f;
path.lineTo(offx, y + offy);
- hist.setPoint(offx, y + offy);
+ hist.setLastPoint(offx, y + offy);
+ hist.setLastKnot(offx, y + offy);
}
public int getNumKnotsAdded()
|