1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

PixelPaint: Allow toggling the active layer boundary display rect

Let the user opt out of painting a rectangle around the currently
active layer.
This commit is contained in:
Andreas Kling 2021-11-19 17:26:49 +01:00
parent 85e5586a27
commit 4bd4ce439a
5 changed files with 28 additions and 1 deletions

View file

@ -101,7 +101,7 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
painter.draw_rect(m_editor_image_rect.inflated(2, 2), Color::Black);
m_image->paint_into(painter, m_editor_image_rect);
if (m_active_layer) {
if (m_active_layer && m_show_active_layer_boundary) {
painter.draw_rect(enclosing_int_rect(image_rect_to_editor_rect(m_active_layer->relative_rect())).inflated(2, 2), Color::Black);
}
@ -700,4 +700,13 @@ Result<void, String> ImageEditor::save_project_to_fd_and_close(int fd) const
return {};
}
void ImageEditor::set_show_active_layer_boundary(bool show)
{
if (m_show_active_layer_boundary == show)
return;
m_show_active_layer_boundary = show;
update();
}
}