mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:18:14 +00:00
PixelPaint: Clip the gradient tool preview to the active layer rect
This makes it easier to see what the result will be when using two solid colors.
This commit is contained in:
parent
55d573afa4
commit
fd9b6878f6
1 changed files with 2 additions and 1 deletions
|
@ -176,7 +176,8 @@ void GradientTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
|
|||
|
||||
GUI::Painter painter(*m_editor);
|
||||
painter.add_clip_rect(event.rect());
|
||||
draw_gradient(painter, true, m_editor->content_to_frame_position(layer->location()), m_editor->scale(), m_editor->content_rect());
|
||||
auto gradient_clip_rect = m_editor->content_to_frame_rect(layer->relative_rect()).to_type<int>().intersected(m_editor->content_rect());
|
||||
draw_gradient(painter, true, m_editor->content_to_frame_position(layer->location()), m_editor->scale(), gradient_clip_rect);
|
||||
}
|
||||
|
||||
void GradientTool::on_primary_color_change(Color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue