[gimp/goat-invasion: 283/412] plugins/newsprint: remove assumption that tiles are square



commit ada97041415ab8f18289228a00338dbc7c2b47a6
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Tue Mar 27 19:58:02 2012 +0100

    plugins/newsprint: remove assumption that tiles are square

 plug-ins/common/newsprint.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/newsprint.c b/plug-ins/common/newsprint.c
index 8ad2275..9f7a807 100644
--- a/plug-ins/common/newsprint.c
+++ b/plug-ins/common/newsprint.c
@@ -1757,6 +1757,7 @@ newsprint (GimpDrawable *drawable,
   gint          has_alpha;
   gint          b;
   gint          tile_width;
+  gint          tile_height;
   gint          width;
   gint          row, col;
   gint          x, y, x_step, y_step;
@@ -1786,6 +1787,7 @@ newsprint (GimpDrawable *drawable,
   width *= oversample;
 
   tile_width = gimp_tile_width ();
+  tile_height = gimp_tile_height ();
 
   bpp        = gimp_drawable_bpp (drawable->drawable_id);
 
@@ -1878,13 +1880,13 @@ do {                                                            \
   progress     = 0;
   max_progress = (x2 - x1) * (y2 - y1);
 
-  for (y = y1; y < y2; y += tile_width - (y % tile_width))
+  for (y = y1; y < y2; y += tile_height - (y % tile_height))
     {
       for (x = x1; x < x2; x += tile_width - (x % tile_width))
         {
           /* snap to tile boundary */
           x_step = tile_width - (x % tile_width);
-          y_step = tile_width - (y % tile_width);
+          y_step = tile_height - (y % tile_height);
           /* don't step off the end of the image */
           x_step = MIN (x_step, x2 - x);
           y_step = MIN (y_step, y2 - y);



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