[gegl] buffer: in gegl_rectangle_is_empty(), return TRUE if width *or* height is 0



commit a0cdd4aceb11d3963f36028964ac7c43325e2810
Author: Ell <ell_se yahoo com>
Date:   Fri Jan 11 07:54:33 2019 -0500

    buffer: in gegl_rectangle_is_empty(), return TRUE if width *or* height is 0
    
    ... instead of if *both* are 0.

 gegl/buffer/gegl-rectangle.c | 2 +-
 gegl/buffer/gegl-rectangle.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gegl/buffer/gegl-rectangle.c b/gegl/buffer/gegl-rectangle.c
index d2f8f709c..dde4c8fc5 100644
--- a/gegl/buffer/gegl-rectangle.c
+++ b/gegl/buffer/gegl-rectangle.c
@@ -218,7 +218,7 @@ gboolean
 gegl_rectangle_is_empty (const GeglRectangle *r)
 {
   g_return_val_if_fail (r != NULL, FALSE);
-  return r->width == 0 && r->height == 0;
+  return r->width == 0 || r->height == 0;
 }
 
 GeglRectangle *
diff --git a/gegl/buffer/gegl-rectangle.h b/gegl/buffer/gegl-rectangle.h
index c476425e5..36174cba7 100644
--- a/gegl/buffer/gegl-rectangle.h
+++ b/gegl/buffer/gegl-rectangle.h
@@ -129,7 +129,7 @@ gboolean    gegl_rectangle_equal_coords  (const GeglRectangle *rectangle,
  *
  * Check if a rectangle has zero area.
  *
- * Returns TRUE if @rectangle height and width are both zero.
+ * Returns TRUE if the width or height of @rectangle is 0.
  */
 gboolean    gegl_rectangle_is_empty     (const GeglRectangle *rectangle);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]