summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/kitfox/svg/PatternSVG.java7
-rw-r--r--src/main/java/com/kitfox/svg/SVGElement.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/kitfox/svg/PatternSVG.java b/src/main/java/com/kitfox/svg/PatternSVG.java
index c1a32e9..e2bc93b 100644
--- a/src/main/java/com/kitfox/svg/PatternSVG.java
+++ b/src/main/java/com/kitfox/svg/PatternSVG.java
@@ -239,7 +239,12 @@ public class PatternSVG extends FillElement {
tileHeight *= stretchY;
}
-
+ if (tileWidth == 0 || tileHeight == 0)
+ {
+ //Use defaults if tile has degenerate size
+ return;
+ }
+
BufferedImage buf = new BufferedImage(tileWidth, tileHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = buf.createGraphics();
g.setClip(0, 0, tileWidth, tileHeight);
diff --git a/src/main/java/com/kitfox/svg/SVGElement.java b/src/main/java/com/kitfox/svg/SVGElement.java
index 2370906..4a330f4 100644
--- a/src/main/java/com/kitfox/svg/SVGElement.java
+++ b/src/main/java/com/kitfox/svg/SVGElement.java
@@ -486,7 +486,7 @@ abstract public class SVGElement implements Serializable
}
//Alter layout for relevant attributes
- if ("id".equals(styAttr.getStringValue()))
+ if ("id".equals(styAttr.getName()))
{
diagram.removeElement(this.id);
this.id = name;