Commit 91ac0e40 authored by Daniel Sabo's avatar Daniel Sabo

Clean up get_bounding_box for composer/composer3

It is safe to write to one of the inputs of gegl_rectangle_bounding_box
so the deep if chain is unnecessary.
parent f98c02a3
......@@ -147,20 +147,12 @@ get_bounding_box (GeglOperation *self)
GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (self, "input");
GeglRectangle *aux_rect = gegl_operation_source_get_bounding_box (self, "aux");
if (!in_rect)
{
if (aux_rect)
return *aux_rect;
return result;
}
if (in_rect)
result = *in_rect;
if (aux_rect)
{
gegl_rectangle_bounding_box (&result, in_rect, aux_rect);
}
else
{
return *in_rect;
}
gegl_rectangle_bounding_box (&result, &result, aux_rect);
return result;
}
......
......@@ -163,31 +163,15 @@ get_bounding_box (GeglOperation *self)
GeglRectangle *aux_rect = gegl_operation_source_get_bounding_box (self, "aux");
GeglRectangle *aux2_rect = gegl_operation_source_get_bounding_box (self, "aux2");
if (!in_rect)
if (!aux_rect)
if (!aux2_rect)
return result;
else
return *aux2_rect;
else
if (!aux2_rect)
return *aux_rect;
else
gegl_rectangle_bounding_box (&result, aux_rect, aux2_rect);
else
if (!aux_rect)
if (!aux2_rect)
return *in_rect;
else
gegl_rectangle_bounding_box (&result, in_rect, aux2_rect);
else
if (!aux2_rect)
gegl_rectangle_bounding_box (&result, in_rect, aux_rect);
else
{
gegl_rectangle_bounding_box (&result, in_rect, aux_rect);
gegl_rectangle_bounding_box (&result, &result, aux2_rect);
}
if (in_rect)
result = *in_rect;
if (aux_rect)
gegl_rectangle_bounding_box (&result, &result, aux_rect);
if (aux2_rect)
gegl_rectangle_bounding_box (&result, &result, aux2_rect);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment