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)]
This commit is contained in:
marq24 2020-08-02 10:25:57 +02:00 committed by Emux
parent ab32f25a7c
commit 8602b5780a
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3

View File

@ -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<Drawable> 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;
}
}