From 2651e7ddc9acfcf6c5103d4728493e4e8f2f7a33 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 2 Apr 2021 09:48:41 -0400 Subject: [PATCH] In move/rotate cancel, check whether graph has changed before popping (closes #8441) --- modules/modes/move.js | 4 ++-- modules/modes/rotate.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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);