From 963566c2c1c45e7e30316dd37d851718f4f1aa9a Mon Sep 17 00:00:00 2001 From: kitfox Date: Tue, 16 Oct 2012 22:47:09 +0000 Subject: Fixing path calculation error for continuous joins. git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@137 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b --- src/main/java/com/kitfox/svg/pathcmd/Horizontal.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/kitfox/svg/pathcmd/Horizontal.java') diff --git a/src/main/java/com/kitfox/svg/pathcmd/Horizontal.java b/src/main/java/com/kitfox/svg/pathcmd/Horizontal.java index 5aa6c37..c25d94c 100644 --- a/src/main/java/com/kitfox/svg/pathcmd/Horizontal.java +++ b/src/main/java/com/kitfox/svg/pathcmd/Horizontal.java @@ -42,6 +42,11 @@ public class Horizontal extends PathCommand { public Horizontal() { } + public String toString() + { + return "H " + x; + } + public Horizontal(boolean isRelative, float x) { super(isRelative); this.x = x; @@ -51,11 +56,12 @@ public class Horizontal 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 = hist.history[0].y; + float offx = isRelative ? hist.lastPoint.x : 0f; + float offy = hist.lastPoint.y; path.lineTo(x + offx, offy); - hist.setPoint(x + offx, offy); + hist.setLastPoint(x + offx, offy); + hist.setLastKnot(x + offx, offy); } public int getNumKnotsAdded() -- cgit v1.2.3-55-g7522