mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-17 08:43:11 +00:00
Show brush preview for custom brushes when using Paint Bucket tool (fix #4052)
This commit is contained in:
parent
6c06a48456
commit
8b747b4d09
@ -1152,8 +1152,8 @@ public:
|
||||
}
|
||||
// Case: during brush preview of PaintBucket Tool
|
||||
else if (loop->getController()->isOnePoint()) {
|
||||
m_u = m_brush->bounds().w / 2;
|
||||
m_v = m_brush->bounds().h / 2;
|
||||
m_u = 0;
|
||||
m_v = 0;
|
||||
}
|
||||
else {
|
||||
m_u = ((m_brush->patternOrigin().x % loop->sprite()->width()) - loop->getCelOrigin().x) % m_width;
|
||||
|
@ -166,8 +166,9 @@ void BrushPreview::show(const gfx::Point& screenPos)
|
||||
const bool isFloodfill = m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill();
|
||||
// TODO add support for "tile-brushes"
|
||||
gfx::Rect origBrushBounds =
|
||||
(isFloodfill || site.tilemapMode() == TilemapMode::Tiles ? gfx::Rect(0, 0, 1, 1):
|
||||
brush->bounds());
|
||||
((isFloodfill && brush->type() != BrushType::kImageBrushType) ||
|
||||
site.tilemapMode() == TilemapMode::Tiles ? gfx::Rect(0, 0, 1, 1)
|
||||
: brush->bounds());
|
||||
gfx::Rect brushBounds = origBrushBounds;
|
||||
|
||||
// Cursor in the screen (view)
|
||||
|
@ -973,9 +973,14 @@ public:
|
||||
tools::WellKnownPointShapes::Brush);
|
||||
}
|
||||
else if (m_pointShape->isFloodFill()) {
|
||||
m_pointShape = App::instance()->toolBox()->getPointShapeById
|
||||
(m_tilesMode ? tools::WellKnownPointShapes::Tile:
|
||||
tools::WellKnownPointShapes::Pixel);
|
||||
const char* id;
|
||||
if (m_tilesMode)
|
||||
id = tools::WellKnownPointShapes::Tile;
|
||||
else if (m_brush->type() == BrushType::kImageBrushType)
|
||||
id = tools::WellKnownPointShapes::Brush;
|
||||
else
|
||||
id = tools::WellKnownPointShapes::Pixel;
|
||||
m_pointShape = App::instance()->toolBox()->getPointShapeById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user