(repost - got lost somewhere the first time)

I stumbled upon this link describing the use of the Diagonal (45 degree
diagonal from each corner of an image) as the optimum crop guide ("better"
than rule-of-thirds or golden rule).

http://www.diagonaalmethode.nl/

I hacked together a patch to add the Diagonal crop guide. So, should I open
an enhancement bugzilla and include the patch? My patch isn't perfect -
hence posting here since it requires some discussion. If the crop box is a
portrait, then it works, if landscape (X > Y) then the guides extend beyond
the crop rectangle. I don't know how to fix this cleanly (using an if
statement doesn't seem efficient).

Any guidance (on or off list) would be appreciated. Thanks...Tim

-- 
Tim Jedlicka, Network Entomologist
[EMAIL PROTECTED], http://www.galifree.com

Patch against gimp-2.4.1

--- gimprectangletool.c      2007-11-05 00:37:39.000000000 -0600
+++ gimprectangletool.c.diag 2007-11-05 17:06:49.000000000 -0600
@@ -1746,6 +1746,25 @@ gimp_rectangle_tool_draw_guides (GimpDra
                                 ((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
                                 y2, FALSE);
       break;
+
+    case GIMP_RECTANGLE_GUIDE_DIAGONAL:
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1,y1,
+                                x2,y1 + (x2 - x1),
+                                FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1,y2,
+                               x2,y2 - (x2 - x1),
+                                FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x2,y1,
+                               x1,y1 + (x2 - x1),
+                                FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                               x2,y2,
+                               x1,y2 - (x2 - x1),
+                                FALSE);
+      break;
     }
 }

--- tools-enums.h       2007-11-05 16:56:47.000000000 -0600
+++ tools-enums.h.diag  2007-11-05 16:57:56.000000000 -0600
@@ -45,7 +45,8 @@ typedef enum
   GIMP_RECTANGLE_GUIDE_NONE,          /*< desc="No guides"       >*/
   GIMP_RECTANGLE_GUIDE_CENTER_LINES,  /*< desc="Center lines"    >*/
   GIMP_RECTANGLE_GUIDE_THIRDS,        /*< desc="Rule of thirds"  >*/
-  GIMP_RECTANGLE_GUIDE_GOLDEN         /*< desc="Golden sections" >*/
+  GIMP_RECTANGLE_GUIDE_GOLDEN,         /*< desc="Golden sections" >*/
+  GIMP_RECTANGLE_GUIDE_DIAGONAL         /*< desc="Diagonal lines" >*/
 } GimpRectangleGuide;

--- tools-enums.c       2007-11-05 16:56:38.000000000 -0600
+++ tools-enums.c.diag  2007-11-05 16:59:07.000000000 -0600
@@ -50,6 +50,7 @@ gimp_rectangle_guide_get_type (void)
     { GIMP_RECTANGLE_GUIDE_CENTER_LINES,
"GIMP_RECTANGLE_GUIDE_CENTER_LINES", "center-lines" },
     { GIMP_RECTANGLE_GUIDE_THIRDS, "GIMP_RECTANGLE_GUIDE_THIRDS", "thirds"
},
     { GIMP_RECTANGLE_GUIDE_GOLDEN, "GIMP_RECTANGLE_GUIDE_GOLDEN", "golden"
},
+    { GIMP_RECTANGLE_GUIDE_DIAGONAL, "GIMP_RECTANGLE_GUIDE_DIAGONAL",
"diagonal" },
     { 0, NULL, NULL }
   };

@@ -59,6 +60,7 @@ gimp_rectangle_guide_get_type (void)
     { GIMP_RECTANGLE_GUIDE_CENTER_LINES, N_("Center lines"), NULL },
     { GIMP_RECTANGLE_GUIDE_THIRDS, N_("Rule of thirds"), NULL },
     { GIMP_RECTANGLE_GUIDE_GOLDEN, N_("Golden sections"), NULL },
+    { GIMP_RECTANGLE_GUIDE_DIAGONAL, N_("Diagonal lines"), NULL },
     { 0, NULL, NULL }
   };
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to