[gegl] grid: make mipmap aware



commit 594a5b8337359d3b1a7d546211ade187f5b31084
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Mar 16 19:06:11 2017 +0100

    grid: make mipmap aware

 operations/common/grid.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/operations/common/grid.c b/operations/common/grid.c
index 276921a..c621ba1 100644
--- a/operations/common/grid.c
+++ b/operations/common/grid.c
@@ -104,13 +104,13 @@ process (GeglOperation       *operation,
     {
       gint nx,ny;
 
-      nx = (x - o->x_offset) % o->x;
-      ny = (y - o->y_offset) % o->y;
+      nx = (x - o->x_offset) % (o->x>>level);
+      ny = (y - o->y_offset) % (o->y>>level);
       /* handle case where % returns a negative number */
       nx += nx < 0 ? o->x : 0;
       ny += ny < 0 ? o->y : 0;
 
-      if (nx < o->line_width || ny < o->line_height)
+      if (nx < (o->line_width>>level) || ny < (o->line_height>>level))
         {
           out_pixel[0]=line_color[0];
           out_pixel[1]=line_color[1];


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