simplified code for statusbar display.

2006-08-14  Sven Neumann  <sven@gimp.org>

	* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
	simplified code for statusbar display.
This commit is contained in:
Sven Neumann 2006-08-14 14:17:18 +00:00 committed by Sven Neumann
parent f47007d897
commit 36b4860e6d
2 changed files with 17 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2006-08-14 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
simplified code for statusbar display.
2006-08-14 Sven Neumann <sven@gimp.org> 2006-08-14 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.c: changed the limits for "pressx" * app/tools/gimprectangletool.c: changed the limits for "pressx"

View File

@ -1365,30 +1365,26 @@ gimp_rectangle_tool_motion (GimpTool *tool,
gimp_rectangle_tool_update_options (rectangle, display); gimp_rectangle_tool_update_options (rectangle, display);
if (function != RECT_MOVING && if (function != RECT_MOVING && function != RECT_EXECUTING)
function != RECT_EXECUTING)
{ {
gboolean constrain = gimp_rectangle_tool_get_constrain (rectangle); gint w, h;
gimp_tool_pop_status (tool, display); gimp_tool_pop_status (tool, display);
if (constrain)
if (gimp_rectangle_tool_get_constrain (rectangle))
{ {
gimp_tool_push_status_coords (tool, display, w = MIN (rx2, max_x) - MAX (rx1, min_x);
_("Rectangle: "), h = MIN (ry2, max_y) - MAX (ry1, min_y);
(rx2 > max_x ? max_x : rx2) -
(rx1 < min_x ? min_x : rx1),
" × ",
(ry2 > max_y ? max_y : ry2) -
(ry1 < min_y ? min_y : ry1));
} }
else else
{ {
gimp_tool_push_status_coords (tool, display, w = rx2 - rx1;
_("Rectangle: "), h = ry2 - ry1;
rx2 - rx1,
" × ",
ry2 - ry1);
} }
if (w > 0 && h > 0)
gimp_tool_push_status_coords (tool, display,
_("Rectangle: "), w, " × ", h);
} }
if (function == RECT_CREATING) if (function == RECT_CREATING)