shadows for multipolygons

This commit is contained in:
Ansis Brammanis
2013-04-05 12:11:23 -04:00
parent cebf5dc1a6
commit d7cc24b935
2 changed files with 13 additions and 4 deletions
+12 -3
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
});