mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 06:41:08 +00:00
Avoid creating an extra brush for the brush preview
This commit is contained in:
parent
263236deb3
commit
82ab0bc40a
@ -251,7 +251,7 @@ void BrushPreview::show(const gfx::Point& screenPos)
|
||||
{
|
||||
std::unique_ptr<tools::ToolLoop> loop(
|
||||
create_tool_loop_preview(
|
||||
m_editor, extraImage,
|
||||
m_editor, brush, extraImage,
|
||||
extraCelBounds.origin()));
|
||||
if (loop) {
|
||||
loop->getInk()->prepareInk(loop.get());
|
||||
|
@ -829,14 +829,14 @@ public:
|
||||
Editor* editor,
|
||||
tools::Tool* tool,
|
||||
tools::Ink* ink,
|
||||
const BrushRef& brush,
|
||||
const app::Color& fgColor,
|
||||
const app::Color& bgColor,
|
||||
Image* image,
|
||||
const gfx::Point& celOrigin)
|
||||
: ToolLoopBase(editor, editor->getSite(),
|
||||
tool, ink, tool->getController(tools::ToolLoop::Left),
|
||||
App::instance()->contextBar()->activeBrush(tool, ink),
|
||||
tools::ToolLoop::Left, fgColor, bgColor)
|
||||
brush, tools::ToolLoop::Left, fgColor, bgColor)
|
||||
, m_image(image)
|
||||
{
|
||||
m_celOrigin = celOrigin;
|
||||
@ -885,7 +885,9 @@ public:
|
||||
};
|
||||
|
||||
tools::ToolLoop* create_tool_loop_preview(
|
||||
Editor* editor, Image* image,
|
||||
Editor* editor,
|
||||
const doc::BrushRef& brush,
|
||||
Image* image,
|
||||
const gfx::Point& celOrigin)
|
||||
{
|
||||
tools::Tool* tool = editor->getCurrentEditorTool();
|
||||
@ -911,7 +913,7 @@ tools::ToolLoop* create_tool_loop_preview(
|
||||
// Create the new tool loop
|
||||
try {
|
||||
return new PreviewToolLoopImpl(
|
||||
editor, tool, ink,
|
||||
editor, tool, ink, brush,
|
||||
fg, bg, image, celOrigin);
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
|
@ -47,6 +47,7 @@ namespace app {
|
||||
|
||||
tools::ToolLoop* create_tool_loop_preview(
|
||||
Editor* editor,
|
||||
const doc::BrushRef& brush,
|
||||
doc::Image* image,
|
||||
const gfx::Point& celOrigin);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user