Fix problem showing brush boundaries when the active shade includes index 0

This commit is contained in:
David Capello 2015-12-22 12:48:15 -03:00
parent e8ecbbb4d7
commit 3252013134
3 changed files with 6 additions and 1 deletions

View File

@ -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; }

View File

@ -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)];

View File

@ -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))))) {