Commit c4588f12 authored by Nelson A. de Oliveira's avatar Nelson A. de Oliveira Committed by Martin Nordholts

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.
parent b43be361
......@@ -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,
......
......@@ -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 }
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment