From 4ccb951126a21e6e597fe2770112350b929e9192 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Fri, 31 May 2019 11:28:48 +0300 Subject: [PATCH] move check to outermost scope --- apps/opencs/view/render/terraintexturemode.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/opencs/view/render/terraintexturemode.cpp b/apps/opencs/view/render/terraintexturemode.cpp index 468574c03..b8181eed5 100644 --- a/apps/opencs/view/render/terraintexturemode.cpp +++ b/apps/opencs/view/render/terraintexturemode.cpp @@ -235,7 +235,7 @@ void CSVRender::TerrainTextureMode::drag (const QPoint& pos, int diffX, int diff void CSVRender::TerrainTextureMode::dragCompleted(const QPoint& pos) { - if (mDragMode == InteractionType_PrimaryEdit) + if (mDragMode == InteractionType_PrimaryEdit && mIsEditing) { CSMDoc::Document& document = getWorldspaceWidget().getDocument(); QUndoStack& undoStack = document.getUndoStack(); @@ -245,11 +245,8 @@ void CSVRender::TerrainTextureMode::dragCompleted(const QPoint& pos) if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted()) { - if (mIsEditing) - { - undoStack.endMacro(); - mIsEditing = false; - } + undoStack.endMacro(); + mIsEditing = false; } } }