From b10ad5e6b5c190f5ef56615ecadb01ec4c46bf8a Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 13 Sep 2013 00:47:24 +0200 Subject: [PATCH] Support density and non-density pixels in raster style --- .../osmand/render/RenderingRuleProperty.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java index 1fee7ab32a..707aff7587 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java @@ -134,6 +134,15 @@ public class RenderingRuleProperty { public int parseIntValue(String value){ if(type == INT_TYPE){ try { + int colon = value.indexOf(':'); + if(colon != -1) { + int c = 0; + if(c > 0) { + c += Integer.parseInt(value.substring(0, c)); + } + c += Integer.parseInt(value.substring(c + 1)); + return c; + } return Integer.parseInt(value); } catch (NumberFormatException e) { log.error("Rendering parse " + value); @@ -159,6 +168,15 @@ public class RenderingRuleProperty { public float parseFloatValue(String value){ if(type == FLOAT_TYPE){ try { + int colon = value.indexOf(':'); + if(colon != -1) { + float c = 0; + if(c > 0) { + c += Float.parseFloat(value.substring(0, c)); + } + c += Float.parseFloat(value.substring(c + 1)); + return c; + } return Float.parseFloat(value); } catch (NumberFormatException e) { log.error("Rendering parse " + value);