mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
Fix issue where untagged multipolygon member lines would render as lines instead of area edges
Show recents in the ribbon again
This commit is contained in:
@@ -102,6 +102,12 @@ coreGraph.prototype = {
|
||||
return result;
|
||||
},
|
||||
|
||||
parentMultipolygons: function(entity) {
|
||||
return this.parentRelations(entity).filter(function(relation) {
|
||||
return relation.isMultipolygon();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
childNodes: function(entity) {
|
||||
if (this._childNodes[entity.id]) return this._childNodes[entity.id];
|
||||
|
||||
@@ -202,9 +202,10 @@ export function svgPointTransform(projection) {
|
||||
export function svgRelationMemberTags(graph) {
|
||||
return function(entity) {
|
||||
var tags = entity.tags;
|
||||
var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
|
||||
graph.parentRelations(entity).forEach(function(relation) {
|
||||
var type = relation.tags.type;
|
||||
if (type === 'multipolygon' || type === 'boundary') {
|
||||
if ((type === 'multipolygon' && shouldCopyMultipolygonTags) || type === 'boundary') {
|
||||
tags = _extend({}, relation.tags, tags);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -122,8 +122,15 @@ export function svgLines(projection, context) {
|
||||
lines.enter()
|
||||
.append('path')
|
||||
.attr('class', function(d) {
|
||||
|
||||
var prefix = 'way line';
|
||||
if (!d.hasInterestingTags() && graph.parentMultipolygons(d).length > 0) {
|
||||
// fudge the classes to style multipolygon member lines as area edges
|
||||
prefix = 'relation area';
|
||||
}
|
||||
|
||||
var oldMPClass = oldMultiPolygonOuters[d.id] ? 'old-multipolygon ' : '';
|
||||
return 'way line ' + klass + ' ' + selectedClass + oldMPClass + d.id;
|
||||
return prefix + ' ' + klass + ' ' + selectedClass + oldMPClass + d.id;
|
||||
})
|
||||
.call(svgTagClasses())
|
||||
.merge(lines)
|
||||
|
||||
@@ -90,7 +90,7 @@ export function uiModes(context) {
|
||||
var recents = context.presets().getRecents().filter(function(recent) {
|
||||
return recent.geometry !== 'relation';
|
||||
});
|
||||
items = _uniqWith(items.concat(), function(item1, item2) {
|
||||
items = _uniqWith(items.concat(recents), function(item1, item2) {
|
||||
return item1.matches(item2.preset, item2.geometry);
|
||||
});
|
||||
var maxShown = 10;
|
||||
|
||||
Reference in New Issue
Block a user