mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
shadows for multipolygons
This commit is contained in:
+12
-3
@@ -23,8 +23,8 @@ iD.behavior.Hover = function() {
|
||||
}
|
||||
}
|
||||
|
||||
var hover = function(_) {
|
||||
selection = _;
|
||||
var hover = function(__) {
|
||||
selection = __;
|
||||
|
||||
if (!altDisables || !d3.event || !d3.event.altKey) {
|
||||
selection.classed('behavior-hover', true);
|
||||
@@ -32,9 +32,18 @@ iD.behavior.Hover = function() {
|
||||
|
||||
function mouseover() {
|
||||
var datum = d3.event.target.__data__;
|
||||
|
||||
if (datum) {
|
||||
var hovered = [datum.id];
|
||||
|
||||
if (datum.type === 'relation') {
|
||||
hovered = hovered.concat(_.pluck(datum.members, 'id'));
|
||||
}
|
||||
|
||||
hovered = d3.set(hovered);
|
||||
|
||||
selection.selectAll('*')
|
||||
.filter(function(d) { return d === datum; })
|
||||
.filter(function(d) { return d && hovered.has(d.id); })
|
||||
.classed('hover', true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ iD.modes.Select = function(context, selection, initial) {
|
||||
function selected(entity) {
|
||||
if (!entity) return false;
|
||||
if (selection.indexOf(entity.id) >= 0) return true;
|
||||
return d3.select(this).classed('stroke') &&
|
||||
return d3.select(this) &&
|
||||
_.any(context.graph().parentRelations(entity), function(parent) {
|
||||
return selection.indexOf(parent.id) >= 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user