Skip to content

Commit

Permalink
Merge pull request #8442 from openstreetmap/8441-move-rotate
Browse files Browse the repository at this point in the history
In move/rotate cancel, check whether graph has changed before popping
  • Loading branch information
mbrzakovic authored Jun 22, 2021
2 parents a0c2c84 + 2651e7d commit 7cb2ff7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/modes/move.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion modules/modes/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -130,6 +130,7 @@ export function modeRotate(context, entityIDs) {


mode.enter = function() {
_prevGraph = null;
context.features().forceVisible(entityIDs);

behaviors.forEach(context.install);
Expand Down

0 comments on commit 7cb2ff7

Please sign in to comment.