[gimp/gimp-2-6] Bug 602761 - plug-in-grid: Parameters Horizontal/Vertical Spacing and Horizontal/Vertical Offset are



commit acc37a4e5d08c0f97920cd1b6bd757f126cafb45
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 24 14:49:17 2009 +0100

    Bug 602761 - plug-in-grid: Parameters Horizontal/Vertical Spacing and Horizontal/Vertical Offset are reversed
    
    Revert commits bc099a98f306c3246a3ca2fd950d6f1af056e4c4 and
    c77781de8927bac39817424ae5c732ad3b7fe343 from Jul 27 2006;
    also changed refval boundaries of the "width" size entries
    in the spirit of the original fix, only reversed.
    
    Rationale: the "horizontal" parameters all have to affect the
    horizontal *lines*, so have an effect in *vertical* direction.
    
    Will commit a label change on top to clarify this.
    (cherry picked from commit 028b66beba66dd6b1fe0a9a6b825034d3b971b5a)

 plug-ins/common/grid.c |   68 ++++++++++++++++++++++++------------------------
 1 files changed, 34 insertions(+), 34 deletions(-)
---
diff --git a/plug-ins/common/grid.c b/plug-ins/common/grid.c
index e1d40e4..d9d7350 100644
--- a/plug-ins/common/grid.c
+++ b/plug-ins/common/grid.c
@@ -408,12 +408,12 @@ grid (gint32        image_ID,
     {
       gimp_pixel_rgn_get_row (&srcPR, dest, sx1, y, (sx2 - sx1));
 
-      y_offset = y - grid_cfg.voffset;
+      y_offset = y - grid_cfg.hoffset;
       while (y_offset < 0)
-        y_offset += grid_cfg.vspace;
+        y_offset += grid_cfg.hspace;
 
       if ((y_offset +
-           (grid_cfg.hwidth / 2)) % grid_cfg.vspace < grid_cfg.hwidth)
+           (grid_cfg.hwidth / 2)) % grid_cfg.hspace < grid_cfg.hwidth)
         {
           for (x = sx1; x < sx2; x++)
             {
@@ -424,29 +424,29 @@ grid (gint32        image_ID,
 
       for (x = sx1; x < sx2; x++)
         {
-          x_offset = grid_cfg.hspace + x - grid_cfg.hoffset;
+          x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
           while (x_offset < 0)
-            x_offset += grid_cfg.hspace;
+            x_offset += grid_cfg.vspace;
 
           if ((x_offset +
-               (grid_cfg.vwidth / 2)) % grid_cfg.hspace < grid_cfg.vwidth)
+               (grid_cfg.vwidth / 2)) % grid_cfg.vspace < grid_cfg.vwidth)
             {
               pix_composite (&dest[(x-sx1) * bytes],
                              vcolor, bytes, blend, alpha);
             }
 
           if ((x_offset +
-               (grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth
+               (grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth
               &&
-              ((y_offset % grid_cfg.vspace >= grid_cfg.ispace
+              ((y_offset % grid_cfg.hspace >= grid_cfg.ispace
                 &&
-                y_offset % grid_cfg.vspace < grid_cfg.ioffset)
+                y_offset % grid_cfg.hspace < grid_cfg.ioffset)
                ||
-               (grid_cfg.vspace -
-                (y_offset % grid_cfg.vspace) >= grid_cfg.ispace
+               (grid_cfg.hspace -
+                (y_offset % grid_cfg.hspace) >= grid_cfg.ispace
                 &&
-                grid_cfg.vspace -
-                (y_offset % grid_cfg.vspace) < grid_cfg.ioffset)))
+                grid_cfg.hspace -
+                (y_offset % grid_cfg.hspace) < grid_cfg.ioffset)))
             {
               pix_composite (&dest[(x-sx1) * bytes],
                              icolor, bytes, blend, alpha);
@@ -454,23 +454,23 @@ grid (gint32        image_ID,
         }
 
       if ((y_offset +
-           (grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth)
+           (grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth)
         {
           for (x = sx1; x < sx2; x++)
             {
-              x_offset = grid_cfg.hspace + x - grid_cfg.hoffset;
+              x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
               while (x_offset < 0)
-                x_offset += grid_cfg.hspace;
+                x_offset += grid_cfg.vspace;
 
-              if ((x_offset % grid_cfg.hspace >= grid_cfg.ispace
+              if ((x_offset % grid_cfg.vspace >= grid_cfg.ispace
                    &&
-                   x_offset % grid_cfg.hspace < grid_cfg.ioffset)
+                   x_offset % grid_cfg.vspace < grid_cfg.ioffset)
                   ||
-                  (grid_cfg.hspace -
-                   (x_offset % grid_cfg.hspace) >= grid_cfg.ispace
+                  (grid_cfg.vspace -
+                   (x_offset % grid_cfg.vspace) >= grid_cfg.ispace
                    &&
-                   grid_cfg.hspace -
-                   (x_offset % grid_cfg.hspace) < grid_cfg.ioffset))
+                   grid_cfg.vspace -
+                   (x_offset % grid_cfg.vspace) < grid_cfg.ioffset))
                 {
                   pix_composite (&dest[(x-sx1) * bytes],
                                  icolor, bytes, blend, alpha);
@@ -692,15 +692,15 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (width), 2, xres, TRUE);
 
   /*  set the size (in pixels) that will be treated as 0% and 100%  */
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 0, 0.0, drawable->width);
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 1, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 0, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 1, 0.0, drawable->width);
   gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 2, 0.0, drawable->width);
 
   /*  set upper and lower limits (in pixels)  */
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 0, 0.0,
-                                         drawable->width);
-  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 1, 0.0,
                                          drawable->height);
+  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 1, 0.0,
+                                         drawable->width);
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));
@@ -766,15 +766,15 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (space), 2, xres, TRUE);
 
   /*  set the size (in pixels) that will be treated as 0% and 100%  */
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 0, 0.0, drawable->width);
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 1, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 0, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 1, 0.0, drawable->width);
   gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 2, 0.0, drawable->width);
 
   /*  set upper and lower limits (in pixels)  */
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 0, 1.0,
-                                         drawable->width);
-  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 1, 1.0,
                                          drawable->height);
+  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 1, 1.0,
+                                         drawable->width);
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));
@@ -833,15 +833,15 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (offset), 2, xres, TRUE);
 
   /*  set the size (in pixels) that will be treated as 0% and 100%  */
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 0, 0.0, drawable->width);
-  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 1, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 0, 0.0, drawable->height);
+  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 1, 0.0, drawable->width);
   gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 2, 0.0, drawable->width);
 
   /*  set upper and lower limits (in pixels)  */
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 0, 0.0,
-                                         drawable->width);
-  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 1, 0.0,
                                          drawable->height);
+  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 1, 0.0,
+                                         drawable->width);
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));



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