[gimp/gimp-2-8] Bug 772667 - instant freeze on rotate



commit 5473730ba5d6ef7fa8ba16dd70c4fbe37e2ca66f
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 14 22:28:51 2017 +0200

    Bug 772667 - instant freeze on rotate
    
    Limit the number of lines drawn in the transform tool canvas grid to
    one line every 5 image pixels. This should probably be done in display
    pixels, didn't change that yet.
    
    (cherry picked from commit 8f2471b1127a02e3dce3c1ea4ab1dcb356e04776)

 app/display/gimpcanvastransformguides.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpcanvastransformguides.c b/app/display/gimpcanvastransformguides.c
index 60b4862..5ded6b3 100644
--- a/app/display/gimpcanvastransformguides.c
+++ b/app/display/gimpcanvastransformguides.c
@@ -478,17 +478,27 @@ gimp_canvas_transform_guides_draw (GimpCanvasItem   *item,
         width  = MAX (1, private->x2 - private->x1);
         height = MAX (1, private->y2 - private->y1);
 
+        /*  the MIN() in the code below limits the grid to one line
+         *  every 5 image pixels, see bug 772667.
+         */
+
         if (private->type == GIMP_GUIDES_N_LINES)
           {
             if (width <= height)
               {
                 ngx = private->n_guides;
+                ngx = MIN (ngx, width / 5);
+
                 ngy = ngx * MAX (1, height / width);
+                ngy = MIN (ngy, height / 5);
               }
             else
               {
                 ngy = private->n_guides;
+                ngy = MIN (ngy, height / 5);
+
                 ngx = ngy * MAX (1, width / height);
+                ngx = MIN (ngx, width / 5);
               }
           }
         else /* GIMP_GUIDES_SPACING */
@@ -496,7 +506,10 @@ gimp_canvas_transform_guides_draw (GimpCanvasItem   *item,
             gint grid_size = MAX (2, private->n_guides);
 
             ngx = width  / grid_size;
+            ngx = MIN (ngx, width / 5);
+
             ngy = height / grid_size;
+            ngy = MIN (ngy, height / 5);
           }
 
         for (i = 1; i <= ngx; i++)


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