PixelPaint: Reduce verbosity of crop to content feature

This patch reduces the repetitiveness of the crop to content feature
implementation.
This commit is contained in:
faxe1008 2022-08-24 22:46:54 +02:00 committed by Andreas Kling
commit 21358d8a5f
Notes: sideshowbarker 2024-07-17 07:46:22 +09:00
2 changed files with 5 additions and 21 deletions

View file

@ -540,7 +540,7 @@ Optional<Gfx::IntRect> Image::nonempty_content_bounding_rect() const
auto layer_content_rect_in_layer_coordinates = layer.nonempty_content_bounding_rect();
if (!layer_content_rect_in_layer_coordinates.has_value())
continue;
auto layer_content_rect_in_image_coordinates = layer_content_rect_in_layer_coordinates.value().translated(layer.location());
auto layer_content_rect_in_image_coordinates = layer_content_rect_in_layer_coordinates->translated(layer.location());
if (!bounding_rect.has_value())
bounding_rect = layer_content_rect_in_image_coordinates;
else