summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/kitfox/svg/pathcmd/Quadratic.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/kitfox/svg/pathcmd/Quadratic.java')
-rw-r--r--src/main/java/com/kitfox/svg/pathcmd/Quadratic.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/kitfox/svg/pathcmd/Quadratic.java b/src/main/java/com/kitfox/svg/pathcmd/Quadratic.java
index 34ace18..502f4e1 100644
--- a/src/main/java/com/kitfox/svg/pathcmd/Quadratic.java
+++ b/src/main/java/com/kitfox/svg/pathcmd/Quadratic.java
@@ -45,6 +45,12 @@ public class Quadratic extends PathCommand {
public Quadratic() {
}
+ public String toString()
+ {
+ return "Q " + kx + " " + ky
+ + " " + x + " " + y;
+ }
+
public Quadratic(boolean isRelative, float kx, float ky, float x, float y) {
super(isRelative);
this.kx = kx;
@@ -56,11 +62,12 @@ public class Quadratic 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.quadTo(kx + offx, ky + offy, x + offx, y + offy);
- hist.setPointAndKnot(x + offx, y + offy, kx + offx, ky + offy);
+ hist.setLastPoint(x + offx, y + offy);
+ hist.setLastKnot(kx + offx, ky + offy);
}
public int getNumKnotsAdded()