app: add a GIMP_GEGL_RECT utility macro

It is evil, but it is possible to take the address of an inline defined struct
as an argument in C. =)
This commit is contained in:
Øyvind Kolås 2012-03-21 00:08:40 +00:00 committed by Michael Natterer
parent 6274b269ca
commit 390d48d436
2 changed files with 5 additions and 9 deletions

View File

@ -140,15 +140,10 @@ gimp_drawable_offset (GimpDrawable *drawable,
/* Copy the center region */
if (width && height)
{
src_rect.x = src_x;
src_rect.y = src_y;
src_rect.width = width;
src_rect.height = height;
dest_rect.x = dest_x;
dest_rect.y = dest_y;
gegl_buffer_copy (src_buffer, &src_rect, dest_buffer, &dest_rect);
gegl_buffer_copy (src_buffer,
GIMP_GEGL_RECT (src_x, src_y, width, height),
dest_buffer,
GIMP_GEGL_RECT (dest_x,dest_y, width, height));
}
if (wrap_around)

View File

@ -44,5 +44,6 @@ void gimp_gegl_buffer_refetch_tiles (GeglBuffer *buffer)
GeglColor * gimp_gegl_color_new (const GimpRGB *rgb);
#define GIMP_GEGL_RECT(x,y,w,h) (&((GeglRectangle){(x), (y), (w), (h)}))
#endif /* __GIMP_GEGL_UTILS_H__ */