Select standalone points after dragging them (close #5747)

This commit is contained in:
Quincy Morgan
2019-08-21 13:46:04 -05:00
parent 80affe28cf
commit c97ea095f5

View File

@@ -362,6 +362,8 @@ export function modeDragNode(context) {
function end(entity) {
if (_isCancelled) return;
var wasPoint = entity.geometry(context.graph()) === 'point';
var d = datum();
var nope = (d && d.properties && d.properties.nope) || context.surface().classed('nope');
var target = d && d.properties && d.properties.entity; // entity to snap to
@@ -400,14 +402,19 @@ export function modeDragNode(context) {
);
}
var reselection = _restoreSelectedIDs.filter(function(id) {
return context.graph().hasEntity(id);
});
if (wasPoint) {
context.enter(modeSelect(context, [entity.id]));
if (reselection.length) {
context.enter(modeSelect(context, reselection));
} else {
context.enter(modeBrowse(context));
var reselection = _restoreSelectedIDs.filter(function(id) {
return context.graph().hasEntity(id);
});
if (reselection.length) {
context.enter(modeSelect(context, reselection));
} else {
context.enter(modeBrowse(context));
}
}
}