Skip to content

Commit

Permalink
Don't render multipolygon members in yellow when the multipolygon is …
Browse files Browse the repository at this point in the history
…selected (close #6558)
  • Loading branch information
quincylvania committed Jun 26, 2019
1 parent bfd2c13 commit 4ab9712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/modes/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export function modeSelect(context, selectedIDs) {
}
} else {
context.surface()
.selectAll(utilDeepMemberSelector(selectedIDs, context.graph()))
.selectAll(utilDeepMemberSelector(selectedIDs, context.graph(), true /* skipMultipolgonMembers */))
.classed('selected-member', true);
selection
.classed('selected', true);
Expand Down
4 changes: 2 additions & 2 deletions modules/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function utilEntityOrDeepMemberSelector(ids, graph) {

// returns an selector to select entity ids for:
// - deep descendant entityIDs for any of those entities that are relations
export function utilDeepMemberSelector(ids, graph) {
export function utilDeepMemberSelector(ids, graph, skipMultipolgonMembers) {
var idsSet = new Set(ids);
var seen = new Set();
var returners = new Set();
Expand All @@ -108,7 +108,7 @@ export function utilDeepMemberSelector(ids, graph) {

var entity = graph.hasEntity(id);
if (!entity || entity.type !== 'relation') return;

if (skipMultipolgonMembers && entity.isMultipolygon()) return;
entity.members
.map(function(member) { return member.id; })
.forEach(collectDeepDescendants); // recurse
Expand Down

0 comments on commit 4ab9712

Please sign in to comment.