#11496 closed defect (fixed)
[Patch] getVisibleLayersInZOrder() -> Comparator is not transitive
Reported by: | michael2402 | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | 15.08 |
Component: | Core mappaint | Version: | |
Keywords: | gsoc | Cc: |
Description (last modified by )
if (l1 instanceof OsmDataLayer && l2 instanceof OsmDataLayer) { if (l1 == getActiveLayer()) return -1; if (l2 == getActiveLayer()) return 1; return Integer.compare(layers.indexOf(l1), layers.indexOf(l2)); } else return Integer.compare(layers.indexOf(l1), layers.indexOf(l2));
The current comparator implementation is not transitive. Imagine the following layers:
layers = [OSM1, TMS1, OSM2], activeLayer = OSM1
We have OSM1 < TMS1, TMS1 < OSM2, OSM2 < OSM1.
What was the Idea behind the Comparator? My idea would be that it should push the avtive data layer above all adjacent OSM layers. So it would change this:
[OSM1, OSM2, OSM3, TMS1, OSM4], activeLayer = OSM2 to [OSM1, OSM3, OSM2, TMS1, OSM4]
Attachments (2)
Change History (19)
comment:1 Changed 8 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
Obsolete with patch #11631, I added a new layer ordering code there.
comment:4 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Changed 8 years ago by
Attachment: | 0001-Fixed-11496.patch added |
---|
comment:7 Changed 8 years ago by
This patch should fix the issue. The idea of the comparator - to move the selected data layer to the front but not above e.g. gpx layers - is respected.
comment:8 Changed 8 years ago by
Summary: | getVisibleLayersInZOrder() -> Comparator is not transitive → [Patch] getVisibleLayersInZOrder() -> Comparator is not transitive |
---|
comment:9 Changed 8 years ago by
Keywords: | gsoc added |
---|---|
Milestone: | → 15.07 |
comment:12 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Isn't this problem related to this patch, that my fresh custom build show imagery layer (WMS) above data layer, although in the layer list it's the opposite? When I moved down the data layer, it was showed on the top of WMS imagery layer.
comment:13 Changed 8 years ago by
I missed a Collections.reverse(ret); when preparing the patch... It should not be there.
Changed 8 years ago by
Attachment: | 0002-Fixed-a-Collections.reverse-that-should-not-be-there.patch added |
---|
Replying to michael2402:
That's very old stuff, it was done in r1943 to address #3228. Probably to paint GPX layers behind OSM data layers.