mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-26 09:19:27 +00:00
Block the document in MovingCelState so other commands cannot modify it (fix #1078)
This commit is contained in:
parent
4b7eb54511
commit
becdd90789
@ -34,9 +34,10 @@ namespace app {
|
||||
using namespace ui;
|
||||
|
||||
MovingCelState::MovingCelState(Editor* editor, MouseMessage* msg)
|
||||
: m_canceled(false)
|
||||
: m_reader(UIContext::instance(), 500)
|
||||
, m_canceled(false)
|
||||
{
|
||||
ContextWriter writer(UIContext::instance(), 500);
|
||||
ContextWriter writer(m_reader);
|
||||
Document* document = editor->document();
|
||||
auto range = App::instance()->timeline()->range();
|
||||
LayerImage* layer = static_cast<LayerImage*>(editor->layer());
|
||||
@ -92,7 +93,7 @@ bool MovingCelState::onMouseUp(Editor* editor, MouseMessage* msg)
|
||||
|
||||
// If the user didn't cancel the operation...
|
||||
if (!m_canceled) {
|
||||
ContextWriter writer(UIContext::instance(), 500);
|
||||
ContextWriter writer(m_reader);
|
||||
Transaction transaction(writer.context(), "Cel Movement", ModifyDocument);
|
||||
DocumentApi api = document->getApi(transaction);
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "app/ui/editor/standby_state.h"
|
||||
|
||||
#include "app/context_access.h"
|
||||
#include "doc/cel_list.h"
|
||||
|
||||
#include <vector>
|
||||
@ -34,6 +35,7 @@ namespace app {
|
||||
virtual bool requireBrushPreview() override { return false; }
|
||||
|
||||
private:
|
||||
ContextReader m_reader;
|
||||
CelList m_celList;
|
||||
std::vector<gfx::Point> m_celStarts;
|
||||
gfx::Point m_celOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user