mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Fix nopefilters by testing the original id for the filter
This commit is contained in:
@@ -76,6 +76,7 @@ export function svgAreas(projection, context) {
|
||||
|
||||
// NOPE
|
||||
var nopes = selection.selectAll('.area.target-nope')
|
||||
.filter(function(d) { return filter({ id: d.properties.originalID }); })
|
||||
.data(data.nopes, function key(d) { return d.id; });
|
||||
|
||||
// exit
|
||||
|
||||
@@ -245,6 +245,9 @@ export function svgSegmentWay(way, graph, activeID) {
|
||||
features.active.push({
|
||||
'type': 'Feature',
|
||||
'id': way.id + '-nope', // break the ids on purpose
|
||||
'properties': {
|
||||
'originalID': way.id
|
||||
},
|
||||
'geometry': {
|
||||
'type': 'MultiLineString',
|
||||
'coordinates': coordGroups.active
|
||||
|
||||
@@ -72,6 +72,7 @@ export function svgLines(projection, context) {
|
||||
|
||||
// NOPE
|
||||
var nopes = selection.selectAll('.line.target-nope')
|
||||
.filter(function(d) { return filter({ id: d.properties.originalID }); })
|
||||
.data(data.nopes, function key(d) { return d.id; });
|
||||
|
||||
// exit
|
||||
@@ -101,6 +102,11 @@ export function svgLines(projection, context) {
|
||||
|
||||
|
||||
function drawLineGroup(selection, klass, isSelected) {
|
||||
// Note: Don't add `.selected` class in draw modes
|
||||
var mode = context.mode();
|
||||
var isDrawing = mode && /^draw/.test(mode.id);
|
||||
var selectedClass = (!isDrawing && isSelected) ? 'selected ' : '';
|
||||
|
||||
var lines = selection
|
||||
.selectAll('path')
|
||||
.filter(filter)
|
||||
@@ -109,13 +115,13 @@ export function svgLines(projection, context) {
|
||||
lines.exit()
|
||||
.remove();
|
||||
|
||||
// Optimization: call simple TagClasses only on enter selection. This
|
||||
// Optimization: Call expensive TagClasses only on enter selection. This
|
||||
// works because osmEntity.key is defined to include the entity v attribute.
|
||||
lines.enter()
|
||||
.append('path')
|
||||
.attr('class', function(d) {
|
||||
return 'way line ' + klass + ' ' + d.id + (isSelected ? ' selected' : '') +
|
||||
(oldMultiPolygonOuters[d.id] ? ' old-multipolygon' : '');
|
||||
var oldMPClass = oldMultiPolygonOuters[d.id] ? 'old-multipolygon ' : '';
|
||||
return 'way line ' + klass + ' ' + selectedClass + oldMPClass + d.id;
|
||||
})
|
||||
.call(svgTagClasses())
|
||||
.merge(lines)
|
||||
|
||||
@@ -196,6 +196,7 @@ export function svgVertices(projection, context) {
|
||||
} else {
|
||||
data.nopes.push({
|
||||
id: node.id + '-nope', // not a real osmNode, break the id on purpose
|
||||
originalID: node.id,
|
||||
loc: node.loc
|
||||
});
|
||||
}
|
||||
@@ -222,6 +223,7 @@ export function svgVertices(projection, context) {
|
||||
|
||||
// NOPE
|
||||
var nopes = selection.selectAll('.vertex.target-nope')
|
||||
.filter(function(d) { return filter({ id: d.originalID }); })
|
||||
.data(data.nopes, function key(d) { return d.id; });
|
||||
|
||||
// exit
|
||||
@@ -351,11 +353,8 @@ export function svgVertices(projection, context) {
|
||||
.call(draw, graph, currentVisible(all), sets, filterRendered);
|
||||
|
||||
// Draw touch targets..
|
||||
var filterTargets = function(d) {
|
||||
return isMoving ? true : filterRendered(d);
|
||||
};
|
||||
selection.selectAll('.layer-points .layer-points-targets')
|
||||
.call(drawTargets, graph, currentVisible(all), filterTargets);
|
||||
.call(drawTargets, graph, currentVisible(all), filterRendered);
|
||||
|
||||
|
||||
function currentVisible(which) {
|
||||
|
||||
Reference in New Issue
Block a user