diff options
author | kitfox | 2008-04-23 09:14:46 +0200 |
---|---|---|
committer | kitfox | 2008-04-23 09:14:46 +0200 |
commit | 81cb3459c963b8cf2ec18e7c361ba0154321928c (patch) | |
tree | 394329523669e229fef123dab5397ea0cd096303 | |
parent | Fixed infinate recursion when calling SVGUniverse.loadSVG() (diff) | |
download | svg-salamander-core-81cb3459c963b8cf2ec18e7c361ba0154321928c.tar.gz svg-salamander-core-81cb3459c963b8cf2ec18e7c361ba0154321928c.tar.xz svg-salamander-core-81cb3459c963b8cf2ec18e7c361ba0154321928c.zip |
Fixed problem with rendering patterns based on images set with 0 width or height. Also fixed problem reading id of attributes.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@56 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rw-r--r-- | src/main/java/com/kitfox/svg/PatternSVG.java | 7 | ||||
-rw-r--r-- | src/main/java/com/kitfox/svg/SVGElement.java | 2 |
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;
|