diff options
author | kitfox | 2010-03-17 17:07:42 +0100 |
---|---|---|
committer | kitfox | 2010-03-17 17:07:42 +0100 |
commit | 6a47d6e5f8d4eacb3b96afd99943cc97f80ad3fc (patch) | |
tree | c4c83007323a58c3ce7f00ae2af8b81470a076c7 | |
parent | Added "px|em|ex" to XMLParseUtil. (diff) | |
download | svg-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.java | 5 |
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)
{}
|