From 8602b5780a486644441600958333365a55edc76d Mon Sep 17 00:00:00 2001 From: marq24 Date: Sun, 2 Aug 2020 10:25:57 +0200 Subject: [PATCH] Fix issue with drawing elements with false style (#778) When the style of the drawable has changed the level needs to adjusted before draw(...) is called - in any other case then you have the risk, that the false style will be applied to the drawable [since the false bucket (with wrong style) will be returned when calling t.buckets.get{.*}Bucket(level)] --- vtm-jts/src/org/oscim/layers/vector/VectorLayer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vtm-jts/src/org/oscim/layers/vector/VectorLayer.java b/vtm-jts/src/org/oscim/layers/vector/VectorLayer.java index 87f54741..4f074d20 100644 --- a/vtm-jts/src/org/oscim/layers/vector/VectorLayer.java +++ b/vtm-jts/src/org/oscim/layers/vector/VectorLayer.java @@ -1,6 +1,7 @@ /* * Copyright 2014 Hannes Janetzek * Copyright 2016-2019 devemux86 + * Copyright 2020 marq24 * * This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * @@ -201,11 +202,11 @@ public class VectorLayer extends AbstractVectorLayer implements Gestur for (Drawable d : tmpDrawables) { Style style = d.getStyle(); - draw(t, level, d, style); - if (style != lastStyle) + if (lastStyle != null && lastStyle != style) level += 2; + draw(t, level, d, style); lastStyle = style; } }