summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/kitfox/svg/ShapeElement.java14
-rw-r--r--src/main/java/com/kitfox/svg/pathcmd/BuildHistory.java6
-rw-r--r--src/main/java/com/kitfox/svg/pathcmd/MoveTo.java1
-rw-r--r--src/main/java/com/kitfox/svg/pathcmd/Terminal.java1
4 files changed, 18 insertions, 4 deletions
diff --git a/src/main/java/com/kitfox/svg/ShapeElement.java b/src/main/java/com/kitfox/svg/ShapeElement.java
index 207e096..07b76cf 100644
--- a/src/main/java/com/kitfox/svg/ShapeElement.java
+++ b/src/main/java/com/kitfox/svg/ShapeElement.java
@@ -247,15 +247,21 @@ abstract public class ShapeElement extends RenderableElement
Marker markerMid = null;
if (getStyle(styleAttrib.setName("marker-mid")))
{
- URI uri = styleAttrib.getURIValue(getXMLBase());
- markerMid = (Marker)diagram.getUniverse().getElement(uri);
+ if (!styleAttrib.getStringValue().equals("none"))
+ {
+ URI uri = styleAttrib.getURIValue(getXMLBase());
+ markerMid = (Marker)diagram.getUniverse().getElement(uri);
+ }
}
Marker markerEnd = null;
if (getStyle(styleAttrib.setName("marker-end")))
{
- URI uri = styleAttrib.getURIValue(getXMLBase());
- markerEnd = (Marker)diagram.getUniverse().getElement(uri);
+ if (!styleAttrib.getStringValue().equals("none"))
+ {
+ URI uri = styleAttrib.getURIValue(getXMLBase());
+ markerEnd = (Marker)diagram.getUniverse().getElement(uri);
+ }
}
diff --git a/src/main/java/com/kitfox/svg/pathcmd/BuildHistory.java b/src/main/java/com/kitfox/svg/pathcmd/BuildHistory.java
index d16c11a..ff00120 100644
--- a/src/main/java/com/kitfox/svg/pathcmd/BuildHistory.java
+++ b/src/main/java/com/kitfox/svg/pathcmd/BuildHistory.java
@@ -41,6 +41,7 @@ public class BuildHistory {
// Point2D.Float[] history = new Point2D.Float[2];
Point2D.Float[] history = {new Point2D.Float(), new Point2D.Float()};
+ Point2D.Float start = new Point2D.Float();
int length = 0;
/** Creates a new instance of BuildHistory */
@@ -53,6 +54,11 @@ public class BuildHistory {
length = 1;
}
+ public void setStart(float x, float y)
+ {
+ start.setLocation(x, y);
+ }
+
public void setPointAndKnot(float x, float y, float kx, float ky)
{
history[0].setLocation(x, y);
diff --git a/src/main/java/com/kitfox/svg/pathcmd/MoveTo.java b/src/main/java/com/kitfox/svg/pathcmd/MoveTo.java
index 7339607..e2246a5 100644
--- a/src/main/java/com/kitfox/svg/pathcmd/MoveTo.java
+++ b/src/main/java/com/kitfox/svg/pathcmd/MoveTo.java
@@ -57,6 +57,7 @@ public class MoveTo extends PathCommand {
path.moveTo(x + offx, y + offy);
hist.setPoint(x + offx, y + offy);
+ hist.setStart(x + offx, y + offy);
}
public int getNumKnotsAdded()
diff --git a/src/main/java/com/kitfox/svg/pathcmd/Terminal.java b/src/main/java/com/kitfox/svg/pathcmd/Terminal.java
index a9d1c9f..1cdacf2 100644
--- a/src/main/java/com/kitfox/svg/pathcmd/Terminal.java
+++ b/src/main/java/com/kitfox/svg/pathcmd/Terminal.java
@@ -47,6 +47,7 @@ public class Terminal extends PathCommand {
public void appendPath(GeneralPath path, BuildHistory hist)
{
path.closePath();
+ hist.setPoint(hist.start.x, hist.start.y);
}
public int getNumKnotsAdded()