[gimp/soc-2010-cage] Bug 575911 - Add 'Rule of fifths' crop guide overlay



commit dd5567648083b6961e6bc92521e5c9d809ea3178
Author: Nelson A. de Oliveira <naoliv debian org>
Date:   Wed Jun 23 22:21:57 2010 -0300

    Bug 575911 - Add 'Rule of fifths' crop guide overlay
    
    Implement a rule of fifths guideline for GIMP. See
    http://markhancock.blogspot.com/2006/03/address-basic-composition.html
    for more info.

 app/tools/gimprectangletool.c |   27 +++++++++++++++++++++++++++
 app/tools/tools-enums.c       |    2 ++
 app/tools/tools-enums.h       |    1 +
 3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index 0fd4e00..eba3470 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -1871,6 +1871,33 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
                                 (x1 + 2 * x2) / 3, y2, FALSE);
       break;
 
+    case GIMP_RECTANGLE_GUIDE_FIFTHS:
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1, y1 + (y2 - y1) / 5,
+                                x2, y1 + (y2 - y1) / 5, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1, y1 + 2 * (y2 - y1) / 5,
+                                x2, y1 + 2 * (y2 - y1) / 5, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1, y1 + 3 * (y2 - y1) / 5,
+                                x2, y1 + 3 * (y2 - y1) / 5, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1, y1 + 4 * (y2 - y1) / 5,
+                                x2, y1 + 4 * (y2 - y1) / 5, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1 + (x2 - x1) / 5, y1,
+                                x1 + (x2 - x1) / 5, y2, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1 + 2 * (x2 - x1) / 5, y1,
+                                x1 + 2 * (x2 - x1) / 5, y2, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1 + 3 * (x2 - x1) / 5, y1,
+                                x1 + 3 * (x2 - x1) / 5, y2, FALSE);
+      gimp_draw_tool_draw_line (draw_tool,
+                                x1 + 4 * (x2 - x1) / 5, y1,
+                                x1 + 4 * (x2 - x1) / 5, y2, FALSE);
+      break;
+
     case GIMP_RECTANGLE_GUIDE_GOLDEN:
       gimp_draw_tool_draw_line (draw_tool,
                                 x1,
diff --git a/app/tools/tools-enums.c b/app/tools/tools-enums.c
index 0f243db..c4cf79a 100644
--- a/app/tools/tools-enums.c
+++ b/app/tools/tools-enums.c
@@ -81,6 +81,7 @@ gimp_rectangle_guide_get_type (void)
     { GIMP_RECTANGLE_GUIDE_NONE, "GIMP_RECTANGLE_GUIDE_NONE", "none" },
     { GIMP_RECTANGLE_GUIDE_CENTER_LINES, "GIMP_RECTANGLE_GUIDE_CENTER_LINES", "center-lines" },
     { GIMP_RECTANGLE_GUIDE_THIRDS, "GIMP_RECTANGLE_GUIDE_THIRDS", "thirds" },
+    { GIMP_RECTANGLE_GUIDE_FIFTHS, "GIMP_RECTANGLE_GUIDE_FIFTHS", "fifths" },
     { GIMP_RECTANGLE_GUIDE_GOLDEN, "GIMP_RECTANGLE_GUIDE_GOLDEN", "golden" },
     { GIMP_RECTANGLE_GUIDE_DIAGONALS, "GIMP_RECTANGLE_GUIDE_DIAGONALS", "diagonals" },
     { 0, NULL, NULL }
@@ -91,6 +92,7 @@ gimp_rectangle_guide_get_type (void)
     { GIMP_RECTANGLE_GUIDE_NONE, NC_("rectangle-guide", "No guides"), NULL },
     { 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_FIFTHS, NC_("rectangle-guide", "Rule of fifths"), NULL },
     { GIMP_RECTANGLE_GUIDE_GOLDEN, NC_("rectangle-guide", "Golden sections"), NULL },
     { GIMP_RECTANGLE_GUIDE_DIAGONALS, NC_("rectangle-guide", "Diagonal lines"), NULL },
     { 0, NULL, NULL }
diff --git a/app/tools/tools-enums.h b/app/tools/tools-enums.h
index 3a508a7..874c0de 100644
--- a/app/tools/tools-enums.h
+++ b/app/tools/tools-enums.h
@@ -56,6 +56,7 @@ 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_FIFTHS,        /*< desc="Rule of fifths"  >*/
   GIMP_RECTANGLE_GUIDE_GOLDEN,        /*< desc="Golden sections" >*/
   GIMP_RECTANGLE_GUIDE_DIAGONALS      /*< desc="Diagonal lines"  >*/
 } GimpRectangleGuide;



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