Skip to content

Commit 57e2836

Browse files
committed
Negative rule improvement
1 parent ee1ab06 commit 57e2836

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

docs/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Next version
44

5+
- Negative rule improvement [#1270](https://github.com/mapsforge/vtm/pull/1270)
56
- Render themes: `map-background-outside` [#1262](https://github.com/mapsforge/vtm/pull/1262)
67
- `ThemeCallback.getColor` method [#1251](https://github.com/mapsforge/vtm/pull/1251)
78
- Map theme improvements

vtm/src/org/oscim/theme/rule/Rule.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright 2016 devemux86
44
*
55
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
6-
*
6+
*
77
* This program is free software: you can redistribute it and/or modify it under the
88
* terms of the GNU Lesser General Public License as published by the Free Software
99
* Foundation, either version 3 of the License, or (at your option) any later version.
@@ -318,10 +318,16 @@ public boolean matchesTags(Tag[] tags) {
318318
if (!containsKeys(tags))
319319
return true;
320320

321-
for (Tag tag : tags)
322-
for (String value : values)
323-
if (Utils.equals(value, tag.value))
324-
return !exclusive;
321+
for (Tag tag : tags) {
322+
for (String key : keys) {
323+
if (Utils.equals(key, tag.key)) {
324+
for (String value : values) {
325+
if (Utils.equals(value, tag.value))
326+
return !exclusive;
327+
}
328+
}
329+
}
330+
}
325331

326332
return exclusive;
327333
}

0 commit comments

Comments
 (0)