summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkitfox2010-03-17 17:07:42 +0100
committerkitfox2010-03-17 17:07:42 +0100
commit6a47d6e5f8d4eacb3b96afd99943cc97f80ad3fc (patch)
treec4c83007323a58c3ce7f00ae2af8b81470a076c7
parentAdded "px|em|ex" to XMLParseUtil. (diff)
downloadsvg-salamander-core-6a47d6e5f8d4eacb3b96afd99943cc97f80ad3fc.tar.gz
svg-salamander-core-6a47d6e5f8d4eacb3b96afd99943cc97f80ad3fc.tar.xz
svg-salamander-core-6a47d6e5f8d4eacb3b96afd99943cc97f80ad3fc.zip
XMLParseUtil can now handle unitless coordinates.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@73 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rw-r--r--src/main/java/com/kitfox/svg/xml/XMLParseUtil.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java b/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
index 2bc0c54..3cf1a78 100644
--- a/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
+++ b/src/main/java/com/kitfox/svg/xml/XMLParseUtil.java
@@ -252,8 +252,9 @@ public class XMLParseUtil
float retVal = 0f;
try
{
- retVal = Float.parseFloat(val);
- if (fpMatch.group(6).equals("%")) retVal /= 100;
+ retVal = Float.parseFloat(val);
+ String units = fpMatch.group(6);
+ if ("%".equals(units)) retVal /= 100;
}
catch (Exception e)
{}