This is an automated email from the git hooks/post-receive script. thansen pushed a commit to branch master in repository aseprite.
commit 82cc87d9be24ecf7586987df78b523128712f9f7 Author: David Capello <[email protected]> Date: Mon Nov 24 21:15:59 2014 -0300 Redraw transformation handles when the quick tool is changed --- src/app/ui/editor/editor.cpp | 2 ++ src/app/ui/editor/editor_state.h | 1 + src/app/ui/editor/moving_pixels_state.cpp | 9 ++++++++- src/app/ui/editor/standby_state.cpp | 5 +++++ src/app/ui/editor/standby_state.h | 3 ++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index df6d1ef..9ab9abd 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -1039,6 +1039,8 @@ void Editor::updateQuicktool() // If the tool has changed, we must to update the status bar because // the new tool can display something different in the status bar (e.g. Eyedropper) if (old_quicktool != m_quicktool) { + m_state->onQuickToolChange(this); + updateStatusBar(); App::instance()->getMainWindow()->getContextBar() diff --git a/src/app/ui/editor/editor_state.h b/src/app/ui/editor/editor_state.h index 40988e7..d7c4a7a 100644 --- a/src/app/ui/editor/editor_state.h +++ b/src/app/ui/editor/editor_state.h @@ -76,6 +76,7 @@ namespace app { // MovingPixelsState which drops the pixels in case the user selects // other drawing tool). virtual void onCurrentToolChange(Editor* editor) { } + virtual void onQuickToolChange(Editor* editor) { } // Called when the user presses a mouse button over the editor. virtual bool onMouseDown(Editor* editor, ui::MouseMessage* msg) { return false; } diff --git a/src/app/ui/editor/moving_pixels_state.cpp b/src/app/ui/editor/moving_pixels_state.cpp index 9567398..04b9072 100644 --- a/src/app/ui/editor/moving_pixels_state.cpp +++ b/src/app/ui/editor/moving_pixels_state.cpp @@ -188,9 +188,16 @@ bool MovingPixelsState::onMouseDown(Editor* editor, MouseMessage* msg) contextBar->updateForMovingPixels(); // Start scroll loop - if (checkForScroll(editor, msg)) + if (checkForScroll(editor, msg) || checkForZoom(editor, msg)) return true; + // Call the eyedropper command + tools::Ink* clickedInk = editor->getCurrentEditorInk(); + if (clickedInk->isEyedropper()) { + callEyedropper(editor); + return true; + } + Decorator* decorator = static_cast<Decorator*>(editor->decorator()); Document* document = editor->document(); diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp index e8dca1c..177639a 100644 --- a/src/app/ui/editor/standby_state.cpp +++ b/src/app/ui/editor/standby_state.cpp @@ -122,6 +122,11 @@ void StandbyState::onCurrentToolChange(Editor* editor) editor->invalidate(); } +void StandbyState::onQuickToolChange(Editor* editor) +{ + editor->invalidate(); +} + bool StandbyState::checkForScroll(Editor* editor, MouseMessage* msg) { tools::Ink* clickedInk = editor->getCurrentEditorInk(); diff --git a/src/app/ui/editor/standby_state.h b/src/app/ui/editor/standby_state.h index 23bfaee..b4e7fdd 100644 --- a/src/app/ui/editor/standby_state.h +++ b/src/app/ui/editor/standby_state.h @@ -34,6 +34,7 @@ namespace app { virtual ~StandbyState(); virtual void onAfterChangeState(Editor* editor) override; virtual void onCurrentToolChange(Editor* editor) override; + virtual void onQuickToolChange(Editor* editor) override; virtual bool onMouseDown(Editor* editor, ui::MouseMessage* msg) override; virtual bool onMouseUp(Editor* editor, ui::MouseMessage* msg) override; virtual bool onMouseMove(Editor* editor, ui::MouseMessage* msg) override; @@ -56,6 +57,7 @@ namespace app { // user wants to scroll". bool checkForScroll(Editor* editor, ui::MouseMessage* msg); bool checkForZoom(Editor* editor, ui::MouseMessage* msg); + void callEyedropper(Editor* editor); class Decorator : public EditorDecorator { public: @@ -76,7 +78,6 @@ namespace app { private: void transformSelection(Editor* editor, ui::MouseMessage* msg, HandleType handle); - void callEyedropper(Editor* editor); Decorator* m_decorator; }; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

