From 7ca9f55d43cbba0a198a79299a0620ea3c0ecc03 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 26 Jun 2019 16:04:56 -0400 Subject: [PATCH] 2.x: Don't render multipolygon members in yellow when the multipolygon is selected (re: #6558, re: 4ab97128c4aae04b627cf8f19091c6c0fc1cf5bc) --- modules/modes/select.js | 2 +- modules/util/util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/modes/select.js b/modules/modes/select.js index 2b704fe13..9f59eef6a 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -427,7 +427,7 @@ export function modeSelect(context, selectedIDs) { // Apply selection styling if not in wide selection surface - .selectAll(utilDeepMemberSelector(selectedIDs, context.graph())) + .selectAll(utilDeepMemberSelector(selectedIDs, context.graph(), true /* skipMultipolgonMembers */)) .classed('selected-member', true); surface .selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())) diff --git a/modules/util/util.js b/modules/util/util.js index ceadbcb34..a55f8f011 100644 --- a/modules/util/util.js +++ b/modules/util/util.js @@ -99,7 +99,7 @@ export function utilEntityAndDeepMemberIDs(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(); @@ -116,7 +116,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