Index: gimprectangletool.c
===================================================================
--- gimprectangletool.c	(revision 28151)
+++ gimprectangletool.c	(working copy)
@@ -1887,6 +1887,52 @@
                                 ((1 + SQRT5) * pub_x1 + 2 * pub_x2) / (3 + SQRT5),
                                 pub_y2, FALSE);
       break;
+
+    /* This code implements the method of diagonals discovered by 
+     *   Edwin Westhoff - see http://www.diagonalmethod.info/
+     *   The Diagonal Method is registered on October 23, 2006 in Washington 
+     *   (Library of Congress) under number Txu-328-140 and in Amsterdam 
+     *   (Merkplaats) under number 4.620517.1. on June, 23, 2006.    
+     */
+    case GIMP_RECTANGLE_GUIDE_DIAGONAL:
+      {
+        gdouble square_side;  /* the side of the largest square that can be 
+                               *   fitted in whole into the rectangle 
+                               *   (pub_x1, pub_y1), (pub_x2, pub_y2) 
+                               */
+         
+        square_side = MIN (pub_x2 - pub_x1, pub_y2 - pub_y1);
+
+        /* diagonal from the top-left edge */
+        gimp_draw_tool_draw_line (draw_tool,
+                                  pub_x1, pub_y1,
+                                  pub_x1 + square_side, pub_y1 + square_side,
+                                  FALSE);
+        /* diagonal from the top-right edge */
+        gimp_draw_tool_draw_line (draw_tool,
+                                  pub_x2, pub_y1,
+                                  pub_x2 - square_side, pub_y1 + square_side,
+                                  FALSE);
+
+        /* If user selected a square, we cannot draw from bottom points 
+         *   as we would erase the guides drawn from the top points 
+         */
+        if ((pub_x1 + square_side != pub_x2) || 
+            (pub_y1 + square_side != pub_y2))
+          {
+            /* diagonal from the bottom-left edge */
+            gimp_draw_tool_draw_line (draw_tool,
+                                      pub_x1, pub_y2,
+                                      pub_x1 + square_side, pub_y2 - square_side,
+                                      FALSE);
+            /* diagonal from the bottom-right edge */
+            gimp_draw_tool_draw_line (draw_tool,
+                                      pub_x2, pub_y2,
+                                      pub_x2 - square_side, pub_y2 - square_side,
+                                      FALSE);
+          }
+      }
+      break;      
     }
 }
 
Index: tools-enums.c
===================================================================
--- tools-enums.c	(revision 28151)
+++ tools-enums.c	(working copy)
@@ -51,6 +51,7 @@
     { 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 }
   };
 
@@ -60,6 +61,7 @@
     { GIMP_RECTANGLE_GUIDE_CENTER_LINES, NC_("rectangle-guide", "Center lines"), NULL },
     { GIMP_RECTANGLE_GUIDE_THIRDS, NC_("rectangle-guide", "Rule of thirds"), NULL },
     { GIMP_RECTANGLE_GUIDE_GOLDEN, NC_("rectangle-guide", "Golden sections"), NULL },
+    { GIMP_RECTANGLE_GUIDE_DIAGONAL, NC_("rectangle-guide", "Diagonal lines"), NULL },    
     { 0, NULL, NULL }
   };
 
Index: tools-enums.h
===================================================================
--- tools-enums.h	(revision 28151)
+++ tools-enums.h	(working copy)
@@ -44,7 +44,8 @@
   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;
 
 
