[aseprite] 141/308: Fix problem showing brush boundaries when the active shade includes index 0

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:45:03 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 325201313490a0661a526810978db9d2ef1a00c1
Author: David Capello <davidcapello at gmail.com>
Date:   Tue Dec 22 12:48:15 2015 -0300

    Fix problem showing brush boundaries when the active shade includes index 0
---
 src/app/tools/ink.h                 | 3 +++
 src/app/tools/inks.h                | 1 +
 src/app/ui/editor/brush_preview.cpp | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app/tools/ink.h b/src/app/tools/ink.h
index 1ef6767..c2325d3 100644
--- a/src/app/tools/ink.h
+++ b/src/app/tools/ink.h
@@ -51,6 +51,9 @@ namespace app {
       // Returns true if this ink picks colors from the image
       virtual bool isEyedropper() const { return false; }
 
+      // Returns true if this ink is shading
+      virtual bool isShading() const { return false; }
+
       // Returns true if this ink moves the scroll only
       virtual bool isScrollMovement() const { return false; }
 
diff --git a/src/app/tools/inks.h b/src/app/tools/inks.h
index da49656..21e0922 100644
--- a/src/app/tools/inks.h
+++ b/src/app/tools/inks.h
@@ -118,6 +118,7 @@ public:
   Ink* clone() override { return new ShadingInk(*this); }
 
   bool isPaint() const override { return true; }
+  bool isShading() const override { return true; }
 
   void prepareInk(ToolLoop* loop) override {
     m_proc = ink_processing[INK_SHADING][MID(0, loop->sprite()->pixelFormat(), 2)];
diff --git a/src/app/ui/editor/brush_preview.cpp b/src/app/ui/editor/brush_preview.cpp
index b08e60b..e5adacb 100644
--- a/src/app/ui/editor/brush_preview.cpp
+++ b/src/app/ui/editor/brush_preview.cpp
@@ -126,7 +126,8 @@ void BrushPreview::show(const gfx::Point& screenPos)
     (// Use cursor bounds for inks that are effects (eraser, blur, etc.)
      (ink->isEffect()) ||
      // or when the brush color is transparent and we are not in the background layer
-     (layer && !layer->isBackground() &&
+     (!ink->isShading() &&
+      (layer && !layer->isBackground()) &&
       ((sprite->pixelFormat() == IMAGE_INDEXED && brush_color == mask_index) ||
        (sprite->pixelFormat() == IMAGE_RGB && rgba_geta(brush_color) == 0) ||
        (sprite->pixelFormat() == IMAGE_GRAYSCALE && graya_geta(brush_color) == 0))))) {

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