[gegl/abyss] buffer: fixed LOOP and CLAMP in get_pixel



commit 0c742c3b0a0dd18bdce3345d6cfc1dcf96aa3cd8
Author: Ville Sokk <ville sokk gmail com>
Date:   Thu Jun 28 21:32:43 2012 +0300

    buffer: fixed LOOP and CLAMP in get_pixel

 gegl/buffer/gegl-buffer-access.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 54c47d3..f410954 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -213,14 +213,14 @@ gegl_buffer_get_pixel (GeglBuffer     *buffer,
       {
         case GEGL_ABYSS_CLAMP:
           abyss = gegl_buffer_get_abyss (buffer);
-          x = CLAMP (x, abyss->x, abyss->x+abyss->width);
-          y = CLAMP (y, abyss->y, abyss->x+abyss->height);
+          x = CLAMP (x, abyss->x, abyss->x+abyss->width-1);
+          y = CLAMP (y, abyss->y, abyss->x+abyss->height-1);
           break;
 
         case GEGL_ABYSS_LOOP:
           abyss = gegl_buffer_get_abyss (buffer);
-          x = abyss->x + (x - abyss->x) % abyss->width;
-          y = abyss->y + (y - abyss->y) % abyss->height;
+          x = abyss->x + GEGL_REMAINDER (x - abyss->x, abyss->width);
+          y = abyss->y + GEGL_REMAINDER (y - abyss->y, abyss->height);
           break;
 
         case GEGL_ABYSS_BLACK:



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