hardcode the result of sqrt(5).

2007-03-30  Sven Neumann  <sven@gimp.org>

	* app/tools/gimprectangletool.c (gimp_rectangle_tool_draw_guides):
	hardcode the result of sqrt(5).


svn path=/trunk/; revision=22196
This commit is contained in:
Sven Neumann 2007-03-30 09:26:48 +00:00 committed by Sven Neumann
parent ca83552cd6
commit 4c33327046
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2007-03-30 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.c (gimp_rectangle_tool_draw_guides):
hardcode the result of sqrt(5).
2007-03-29 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.c (gimp_tool_check_click_distance): don't

View File

@ -59,6 +59,8 @@ enum
#define HANDLE_SIZE 50
#define MIN_HANDLE_SIZE 6
#define SQRT5 2.236067977
#define GIMP_RECTANGLE_TOOL_GET_PRIVATE(obj) \
(gimp_rectangle_tool_get_private (GIMP_RECTANGLE_TOOL (obj)))
@ -1612,26 +1614,26 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
case GIMP_RECTANGLE_GUIDE_GOLDEN:
gimp_draw_tool_draw_line (draw_tool,
x1,
(2 * y1 + (1 + sqrt(5)) * y2) / (3 + sqrt(5)),
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5),
x2,
(2 * y1 + (1 + sqrt(5)) * y2) / (3 + sqrt(5)),
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5),
FALSE);
gimp_draw_tool_draw_line (draw_tool,
x1,
((1 + sqrt(5)) * y1 + 2 * y2) / (3 + sqrt(5)),
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5),
x2,
((1 + sqrt(5)) * y1 + 2 * y2) / (3 + sqrt(5)),
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5),
FALSE);
gimp_draw_tool_draw_line (draw_tool,
(2 * x1 + (1 + sqrt(5)) * x2) / (3 + sqrt(5)),
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y1,
(2 * x1 + (1 + sqrt(5)) * x2) / (3 + sqrt(5)),
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y2,
FALSE);
gimp_draw_tool_draw_line (draw_tool,
((1 + sqrt(5)) * x1 + 2 * x2) / (3 + sqrt(5)),
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y1,
((1 + sqrt(5)) * x1 + 2 * x2) / (3 + sqrt(5)),
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y2, FALSE);
break;
}