diff options
author | kitfox | 2012-10-17 00:47:09 +0200 |
---|---|---|
committer | kitfox | 2012-10-17 00:47:09 +0200 |
commit | 963566c2c1c45e7e30316dd37d851718f4f1aa9a (patch) | |
tree | db5cf6c494be698a6edc9e29d8bb5090a0b235fc /src/main/java/com/kitfox/svg/pathcmd/Cubic.java | |
parent | Fixing null transform with linear gradients. (diff) | |
download | svg-salamander-core-963566c2c1c45e7e30316dd37d851718f4f1aa9a.tar.gz svg-salamander-core-963566c2c1c45e7e30316dd37d851718f4f1aa9a.tar.xz svg-salamander-core-963566c2c1c45e7e30316dd37d851718f4f1aa9a.zip |
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
Diffstat (limited to 'src/main/java/com/kitfox/svg/pathcmd/Cubic.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/pathcmd/Cubic.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/com/kitfox/svg/pathcmd/Cubic.java b/src/main/java/com/kitfox/svg/pathcmd/Cubic.java index f61ec4f..8cbdc86 100644 --- a/src/main/java/com/kitfox/svg/pathcmd/Cubic.java +++ b/src/main/java/com/kitfox/svg/pathcmd/Cubic.java @@ -47,6 +47,13 @@ public class Cubic extends PathCommand { public Cubic() {
}
+ public String toString()
+ {
+ return "C " + k1x + " " + k1y
+ + " " + k2x + " " + k2y
+ + " " + x + " " + y;
+ }
+
public Cubic(boolean isRelative, float k1x, float k1y, float k2x, float k2y, float x, float y) {
super(isRelative);
this.k1x = k1x;
@@ -60,11 +67,15 @@ public class Cubic 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.curveTo(k1x + offx, k1y + offy, k2x + offx, k2y + offy, x + offx, y + offy);
- hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+ path.curveTo(k1x + offx, k1y + offy,
+ k2x + offx, k2y + offy,
+ x + offx, y + offy);
+// hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+ hist.setLastPoint(x + offx, y + offy);
+ hist.setLastKnot(k2x + offx, k2y + offy);
}
public int getNumKnotsAdded()
|