From 563c23117e7c81edcd8b29a41e731e48ea79876e Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 1 Jun 2019 11:04:48 -0300 Subject: [PATCH] Fix brush cursor bug with Gradient tool https://community.aseprite.org/t/cursor-for-fill-tool-off-centre/3158 --- src/app/ui/editor/brush_preview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/ui/editor/brush_preview.cpp b/src/app/ui/editor/brush_preview.cpp index d3acc6263..48cb8d241 100644 --- a/src/app/ui/editor/brush_preview.cpp +++ b/src/app/ui/editor/brush_preview.cpp @@ -120,7 +120,7 @@ void BrushPreview::show(const gfx::Point& screenPos) // Get the current tool tools::Ink* ink = m_editor->getCurrentEditorInk(); - bool isFloodfill = m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill(); + const bool isFloodfill = m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill(); // Setup the cursor type depending on several factors (current tool, // foreground color, layer transparency, brush size, etc.). @@ -372,7 +372,7 @@ void BrushPreview::generateBoundaries() m_brushGen == brush->gen()) return; - bool isOnePixel = + const bool isOnePixel = (m_editor->getCurrentEditorTool()->getPointShape(0)->isPixel() || m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill()); Image* brushImage = brush->image(); @@ -398,8 +398,9 @@ void BrushPreview::generateBoundaries() m_brushBoundaries.reset( new MaskBoundaries(mask ? mask: brushImage)); - m_brushBoundaries->offset(-brush->center().x, - -brush->center().y); + if (!isOnePixel) + m_brushBoundaries->offset(-brush->center().x, + -brush->center().y); if (deleteMask) delete mask;