[aseprite] 08/134: Fix #472 - Undo and redo change the size of spray tool

Tobias Hansen thansen at moszumanska.debian.org
Sat Mar 14 17:09:53 UTC 2015


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

thansen pushed a commit to branch master
in repository aseprite.

commit 0e7f424406a5c7f64c4ca632c8d1196881cd2b42
Author: David Capello <davidcapello at gmail.com>
Date:   Sat Oct 25 12:10:52 2014 -0300

    Fix #472 - Undo and redo change the size of spray tool
---
 src/app/ui/context_bar.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp
index a696887..5ec0002 100644
--- a/src/app/ui/context_bar.cpp
+++ b/src/app/ui/context_bar.cpp
@@ -38,6 +38,7 @@
 #include "app/ui/skin/skin_theme.h"
 #include "app/ui_context.h"
 #include "base/bind.h"
+#include "base/scoped_value.h"
 #include "base/unique_ptr.h"
 #include "raster/brush.h"
 #include "raster/conversion_she.h"
@@ -63,6 +64,8 @@ using namespace gfx;
 using namespace ui;
 using namespace tools;
 
+static bool g_updatingFromTool = false;
+
 class ContextBar::BrushTypeField : public ButtonSet {
 public:
   BrushTypeField()
@@ -184,6 +187,8 @@ public:
 private:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -205,6 +210,8 @@ public:
 protected:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -230,6 +237,8 @@ public:
 protected:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -334,6 +343,8 @@ public:
 protected:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -351,6 +362,8 @@ public:
 protected:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -368,6 +381,8 @@ public:
 protected:
   void onValueChange() override {
     IntEntry::onValueChange();
+    if (g_updatingFromTool)
+      return;
 
     ISettings* settings = UIContext::instance()->settings();
     Tool* currentTool = settings->getCurrentTool();
@@ -841,6 +856,8 @@ void ContextBar::onDropPixels(ContextBarObserver::DropAction action)
 
 void ContextBar::updateFromTool(tools::Tool* tool)
 {
+  base::ScopedValue<bool> lockFlag(g_updatingFromTool, true, false);
+
   ISettings* settings = UIContext::instance()->settings();
   IToolSettings* toolSettings = settings->getToolSettings(tool);
   IBrushSettings* brushSettings = toolSettings->getBrush();

-- 
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