diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRule.java b/OsmAnd-java/src/net/osmand/render/RenderingRule.java index 74657b6f93..a153b6337f 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRule.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRule.java @@ -160,6 +160,13 @@ public class RenderingRule { ifElseChildren.add(rr); } + public void addToBeginIfElseChildren(RenderingRule rr){ + if(ifElseChildren == null){ + ifElseChildren = new ArrayList(); + } + ifElseChildren.add(0, rr); + } + public boolean isGroup() { return isGroup; } diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java index a25b3c829d..6cca8467bb 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java @@ -107,8 +107,11 @@ public class RenderingRulesStorage { if (renderingAttributes.containsKey(e.getKey())) { RenderingRule root = renderingAttributes.get(e.getKey()); List list = e.getValue().getIfElseChildren(); + e.getValue().addToBeginIfElseChildren(root); for (RenderingRule every : list) { - root.addIfElseChildren(every); + if(every != root) { + root.addIfElseChildren(every); + } } } else { renderingAttributes.put(e.getKey(), e.getValue());