diff options
Diffstat (limited to 'src/main/java/com/kitfox/svg/pathcmd/LineTo.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/pathcmd/LineTo.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/kitfox/svg/pathcmd/LineTo.java b/src/main/java/com/kitfox/svg/pathcmd/LineTo.java index 2c76508..4ff4442 100644 --- a/src/main/java/com/kitfox/svg/pathcmd/LineTo.java +++ b/src/main/java/com/kitfox/svg/pathcmd/LineTo.java @@ -53,15 +53,21 @@ public class LineTo 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;
path.lineTo(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()
{
return 2;
}
+
+ public String toString()
+ {
+ return "L " + x + " " + y;
+ }
}
|