summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkitfox2008-04-23 09:14:46 +0200
committerkitfox2008-04-23 09:14:46 +0200
commit81cb3459c963b8cf2ec18e7c361ba0154321928c (patch)
tree394329523669e229fef123dab5397ea0cd096303
parentFixed infinate recursion when calling SVGUniverse.loadSVG() (diff)
downloadsvg-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.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;