mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-22 01:21:19 +00:00
Fix brush cursor bug with Gradient tool
https://community.aseprite.org/t/cursor-for-fill-tool-off-centre/3158
This commit is contained in:
parent
fbbb3238a6
commit
563c23117e
@ -120,7 +120,7 @@ void BrushPreview::show(const gfx::Point& screenPos)
|
|||||||
// Get the current tool
|
// Get the current tool
|
||||||
tools::Ink* ink = m_editor->getCurrentEditorInk();
|
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,
|
// Setup the cursor type depending on several factors (current tool,
|
||||||
// foreground color, layer transparency, brush size, etc.).
|
// foreground color, layer transparency, brush size, etc.).
|
||||||
@ -372,7 +372,7 @@ void BrushPreview::generateBoundaries()
|
|||||||
m_brushGen == brush->gen())
|
m_brushGen == brush->gen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool isOnePixel =
|
const bool isOnePixel =
|
||||||
(m_editor->getCurrentEditorTool()->getPointShape(0)->isPixel() ||
|
(m_editor->getCurrentEditorTool()->getPointShape(0)->isPixel() ||
|
||||||
m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill());
|
m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill());
|
||||||
Image* brushImage = brush->image();
|
Image* brushImage = brush->image();
|
||||||
@ -398,6 +398,7 @@ void BrushPreview::generateBoundaries()
|
|||||||
m_brushBoundaries.reset(
|
m_brushBoundaries.reset(
|
||||||
new MaskBoundaries(mask ? mask: brushImage));
|
new MaskBoundaries(mask ? mask: brushImage));
|
||||||
|
|
||||||
|
if (!isOnePixel)
|
||||||
m_brushBoundaries->offset(-brush->center().x,
|
m_brushBoundaries->offset(-brush->center().x,
|
||||||
-brush->center().y);
|
-brush->center().y);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user