[gegl] buffer: fixed LOOP and CLAMP in get_pixel
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: fixed LOOP and CLAMP in get_pixel
- Date: Thu, 2 Aug 2012 19:18:55 +0000 (UTC)
commit e15893a8c2bc480161669b72d2fb03eb15866366
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 cec2437..8dbd934 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]