Skip to content
Permalink
Browse files

Disable undo/redo during map edit operations

Fix #954
  • Loading branch information...
sirjuddington committed Nov 23, 2018
1 parent b7fcdc9 commit d23d61c5bb1a6ad6a66e21f73bda2f69d4f50bb1
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/MapEditor/MapEditContext.cpp
@@ -52,6 +52,7 @@

using MapEditor::Mode;
using MapEditor::SectorMode;
using MapEditor::Input;


// ----------------------------------------------------------------------------
@@ -1372,6 +1373,10 @@ void MapEditContext::recordPropertyChangeUndoStep(MapObject* object)
// ----------------------------------------------------------------------------
void MapEditContext::doUndo()
{
// Don't undo if the input state isn't normal
if (input_.mouseState() != Input::MouseState::Normal)
return;

// Clear selection first, since part of it may become invalid
selection_.clear();

@@ -1404,6 +1409,10 @@ void MapEditContext::doUndo()
// ----------------------------------------------------------------------------
void MapEditContext::doRedo()
{
// Don't redo if the input state isn't normal
if (input_.mouseState() != Input::MouseState::Normal)
return;

// Clear selection first, since part of it may become invalid
selection_.clear();

0 comments on commit d23d61c

Please sign in to comment.
You can’t perform that action at this time.