2.x: Don't render multipolygon members in yellow when the multipolygon is selected (re: #6558, re: 4ab97128c4aae04b627cf8f19091c6c0fc1cf5bc)

This commit is contained in:
Quincy Morgan
2019-06-26 16:04:56 -04:00
parent 6cbdb41e2d
commit 7ca9f55d43
2 changed files with 3 additions and 3 deletions

View File

@@ -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()))

View File

@@ -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