mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Fix bug which we can get stuck on MovingCelState (fix #1315)
This commit is contained in:
parent
4b6fc07b06
commit
1b2b98ec38
@ -36,7 +36,7 @@ MovingCelState::MovingCelState(Editor* editor, MouseMessage* msg)
|
||||
: m_reader(UIContext::instance(), 500)
|
||||
, m_canceled(false)
|
||||
{
|
||||
ContextWriter writer(m_reader);
|
||||
ContextWriter writer(m_reader, 500);
|
||||
Document* document = editor->document();
|
||||
auto range = App::instance()->timeline()->range();
|
||||
LayerImage* layer = static_cast<LayerImage*>(editor->layer());
|
||||
@ -92,7 +92,7 @@ bool MovingCelState::onMouseUp(Editor* editor, MouseMessage* msg)
|
||||
|
||||
// If the user didn't cancel the operation...
|
||||
if (!m_canceled) {
|
||||
ContextWriter writer(m_reader);
|
||||
ContextWriter writer(m_reader, 1000);
|
||||
Transaction transaction(writer.context(), "Cel Movement", ModifyDocument);
|
||||
DocumentApi api = document->getApi(transaction);
|
||||
|
||||
|
@ -221,8 +221,16 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
"Cel is empty, nothing to move");
|
||||
}
|
||||
else {
|
||||
// Change to MovingCelState
|
||||
editor->setState(EditorStatePtr(new MovingCelState(editor, msg)));
|
||||
try {
|
||||
// Change to MovingCelState
|
||||
MovingCelState* newState = new MovingCelState(editor, msg);
|
||||
editor->setState(EditorStatePtr(newState));
|
||||
}
|
||||
catch (const LockedDocumentException& ex) {
|
||||
// TODO break the background task that is locking this sprite
|
||||
StatusBar::instance()->showTip(1000,
|
||||
"Sprite is used by a backup/data recovery task");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user