app: gimp_drawable_update(): optimize a call to

gimp_drawable_get_bounding_box() away.
This commit is contained in:
Michael Natterer 2025-05-31 16:07:07 +02:00
parent 40ace1016d
commit 9e64535c22

View file

@ -1189,24 +1189,23 @@ gimp_drawable_update (GimpDrawable *drawable,
{ {
g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (width < 0) if (width < 0 || height < 0)
{ {
GeglRectangle bounding_box; GeglRectangle bounding_box;
bounding_box = gimp_drawable_get_bounding_box (drawable); bounding_box = gimp_drawable_get_bounding_box (drawable);
x = bounding_box.x; if (width < 0)
width = bounding_box.width; {
} x = bounding_box.x;
width = bounding_box.width;
}
if (height < 0) if (height < 0)
{ {
GeglRectangle bounding_box; y = bounding_box.y;
height = bounding_box.height;
bounding_box = gimp_drawable_get_bounding_box (drawable); }
y = bounding_box.y;
height = bounding_box.height;
} }
if (drawable->private->paint_count == 0) if (drawable->private->paint_count == 0)