[aseprite] 80/128: Block the document in MovingCelState so other commands cannot modify it (fix #1078)

Tobias Hansen thansen at moszumanska.debian.org
Mon May 9 21:24:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit becdd90789ba4a2358d96592e79b424ea7c13318
Author: David Capello <davidcapello at gmail.com>
Date:   Thu Apr 28 15:00:15 2016 -0300

    Block the document in MovingCelState so other commands cannot modify it (fix #1078)
---
 src/app/ui/editor/moving_cel_state.cpp | 7 ++++---
 src/app/ui/editor/moving_cel_state.h   | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/app/ui/editor/moving_cel_state.cpp b/src/app/ui/editor/moving_cel_state.cpp
index 4851565..645c10c 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<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);
 
diff --git a/src/app/ui/editor/moving_cel_state.h b/src/app/ui/editor/moving_cel_state.h
index b96cda3..f7629df 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 <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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list