diff --git a/src/app/ui/editor/moving_cel_state.cpp b/src/app/ui/editor/moving_cel_state.cpp index 4851565de..645c10c18 100644 --- a/src/app/ui/editor/moving_cel_state.cpp +++ b/src/app/ui/editor/moving_cel_state.cpp @@ -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(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); diff --git a/src/app/ui/editor/moving_cel_state.h b/src/app/ui/editor/moving_cel_state.h index b96cda389..f7629dfb3 100644 --- a/src/app/ui/editor/moving_cel_state.h +++ b/src/app/ui/editor/moving_cel_state.h @@ -11,6 +11,7 @@ #include "app/ui/editor/standby_state.h" +#include "app/context_access.h" #include "doc/cel_list.h" #include @@ -34,6 +35,7 @@ namespace app { virtual bool requireBrushPreview() override { return false; } private: + ContextReader m_reader; CelList m_celList; std::vector m_celStarts; gfx::Point m_celOffset;