From 89b97b8e65de19591d582883a858755c69b50f3d Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 29 Oct 2011 22:06:16 -0300 Subject: [PATCH] Fix bug in MovingCelState::onMouseUp(): restore the mask visibility when the position is not changed. --- src/widgets/editor/moving_cel_state.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/widgets/editor/moving_cel_state.cpp b/src/widgets/editor/moving_cel_state.cpp index 9009e6600..6969ed154 100644 --- a/src/widgets/editor/moving_cel_state.cpp +++ b/src/widgets/editor/moving_cel_state.cpp @@ -69,12 +69,12 @@ MovingCelState::~MovingCelState() bool MovingCelState::onMouseUp(Editor* editor, Message* msg) { + Document* document = editor->getDocument(); + // Here we put back the cel into its original coordinate (so we can // add an undoer before). if (m_celStartX != m_celNewX || m_celStartY != m_celNewY) { - Document* document = editor->getDocument(); - // Put the cel in the original position. if (m_cel) m_cel->setPosition(m_celStartX, m_celStartY); @@ -94,11 +94,12 @@ bool MovingCelState::onMouseUp(Editor* editor, Message* msg) undoTransaction.commit(); } + } - if (m_maskVisible) { - document->setMaskVisible(m_maskVisible); - document->generateMaskBoundaries(); - } + // Restore the mask visibility. + if (m_maskVisible) { + document->setMaskVisible(m_maskVisible); + document->generateMaskBoundaries(); } editor->setState(editor->getDefaultState());