move check to outermost scope

pull/541/head
Nelsson Huotari 6 years ago
parent 0880923189
commit 4ccb951126

@ -235,7 +235,7 @@ void CSVRender::TerrainTextureMode::drag (const QPoint& pos, int diffX, int diff
void CSVRender::TerrainTextureMode::dragCompleted(const QPoint& pos) void CSVRender::TerrainTextureMode::dragCompleted(const QPoint& pos)
{ {
if (mDragMode == InteractionType_PrimaryEdit) if (mDragMode == InteractionType_PrimaryEdit && mIsEditing)
{ {
CSMDoc::Document& document = getWorldspaceWidget().getDocument(); CSMDoc::Document& document = getWorldspaceWidget().getDocument();
QUndoStack& undoStack = document.getUndoStack(); QUndoStack& undoStack = document.getUndoStack();
@ -244,15 +244,12 @@ void CSVRender::TerrainTextureMode::dragCompleted(const QPoint& pos)
int index = landtexturesCollection.searchId(mBrushTexture); int index = landtexturesCollection.searchId(mBrushTexture);
if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted()) if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted())
{
if (mIsEditing)
{ {
undoStack.endMacro(); undoStack.endMacro();
mIsEditing = false; mIsEditing = false;
} }
} }
} }
}
void CSVRender::TerrainTextureMode::dragAborted() void CSVRender::TerrainTextureMode::dragAborted()
{ {

Loading…
Cancel
Save