diff --git a/modules/modes/move.js b/modules/modes/move.js index d1cfb7ba8..a03728783 100644 --- a/modules/modes/move.js +++ b/modules/modes/move.js @@ -113,10 +113,10 @@ export function modeMove(context, entityIDs, baseGraph) { function cancel() { if (baseGraph) { - while (context.graph() !== baseGraph) context.pop(); + while (context.graph() !== baseGraph) context.pop(); // reset to baseGraph context.enter(modeBrowse(context)); } else { - context.pop(); + if (_prevGraph) context.pop(); // remove the move context.enter(modeSelect(context, entityIDs)); } stopNudge(); diff --git a/modules/modes/rotate.js b/modules/modes/rotate.js index 454e0e028..3090b469c 100644 --- a/modules/modes/rotate.js +++ b/modules/modes/rotate.js @@ -119,7 +119,7 @@ export function modeRotate(context, entityIDs) { function cancel() { - context.pop(); + if (_prevGraph) context.pop(); // remove the rotate context.enter(modeSelect(context, entityIDs)); } @@ -130,6 +130,7 @@ export function modeRotate(context, entityIDs) { mode.enter = function() { + _prevGraph = null; context.features().forceVisible(entityIDs); behaviors.forEach(context.install);