PixelPaint: Allow the gradient tool to work with selections

Previously the call to layer->did_modify_bitmap() was missing so the
selection was not applied.
This commit is contained in:
MacDue 2023-01-26 23:18:07 +00:00 committed by Linus Groh
parent 681ed93a41
commit 69580d7f0e
Notes: sideshowbarker 2024-07-17 08:34:29 +09:00

View file

@ -216,12 +216,14 @@ void GradientTool::rasterize_gradient()
{
if (!has_gradient_start_end())
return;
auto layer = m_editor->active_layer();
if (!layer)
return;
GUI::Painter painter(m_editor->active_layer()->get_scratch_edited_bitmap());
GUI::Painter painter(layer->get_scratch_edited_bitmap());
draw_gradient(painter);
m_editor->did_complete_action("Gradient Tool"sv);
layer->did_modify_bitmap(layer->get_scratch_edited_bitmap().rect());
m_editor->did_complete_action(tool_name());
reset();
}