From a2c401b0f61e69606171197f65f6fe3210e1c42b Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 5 Jul 2007 11:49:00 +0000 Subject: [PATCH] changed the highlighting of the side handles to follow changes in the 2007-07-05 Sven Neumann * app/tools/gimpdrawtool.c (gimp_draw_tool_draw_corner): changed the highlighting of the side handles to follow changes in the specification. * app/tools/gimprectangletool.c (gimp_rectangle_tool_draw): cosmetics. svn path=/trunk/; revision=22867 --- ChangeLog | 8 ++++ app/tools/gimpdrawtool.c | 72 +++++++++++++++++++---------------- app/tools/gimprectangletool.c | 27 ++++++++----- 3 files changed, 65 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index e78f4bcaaf..5000c551d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-05 Sven Neumann + + * app/tools/gimpdrawtool.c (gimp_draw_tool_draw_corner): changed + the highlighting of the side handles to follow changes in the + specification. + + * app/tools/gimprectangletool.c (gimp_rectangle_tool_draw): cosmetics. + 2007-07-05 Raphaƫl Quinet * plug-ins/common/psp.c (read_layer_block): allow layer dimensions diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index 1bbccd46dc..ae41a723c2 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -942,22 +942,26 @@ gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool, case GTK_ANCHOR_NORTH: gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx1 + 1, ty1 + height, tx2 - 1, ty1 + height); + tx1 + 1, ty1 + height - 1, + tx2 - 1, ty1 + height - 1); break; case GTK_ANCHOR_SOUTH: gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx1 + 1, ty2 - height, tx2 - 1, ty2 - height); + tx1 + 1, ty2 - height, + tx2 - 1, ty2 - height); break; case GTK_ANCHOR_WEST: gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx1 + width, ty1 + 1, tx1 + width, ty2 - 1); + tx1 + width - 1, ty1 + 1, + tx1 + width - 1, ty2 - 1); break; case GTK_ANCHOR_EAST: gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx2 - width, ty1 + 1, tx2 - width, ty2 - 1); + tx2 - width, ty1 + 1, + tx2 - width, ty2 - 1); break; } @@ -992,66 +996,70 @@ gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool, case GTK_ANCHOR_NORTH: gimp_canvas_draw_rectangle (canvas, GIMP_CANVAS_STYLE_XOR, FALSE, - tx1 + 1, ty1 + 1, - tx2 - tx1 - 3, height - 2); + tx1 + top_and_bottom_handle_x_offset, + ty1 + 1, + width, height - 3); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx1 + top_and_bottom_handle_x_offset, + tx1 + top_and_bottom_handle_x_offset + 1, ty1 + 2, - tx1 + top_and_bottom_handle_x_offset, - ty1 + height - 1); + tx1 + top_and_bottom_handle_x_offset + 1, + ty1 + height - 2); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx2 - top_and_bottom_handle_x_offset - 1, + tx1 + top_and_bottom_handle_x_offset + width - 1, ty1 + 2, - tx2 - top_and_bottom_handle_x_offset - 1, - ty1 + height - 1); + tx1 + top_and_bottom_handle_x_offset + width - 1, + ty1 + height - 2); break; case GTK_ANCHOR_SOUTH: gimp_canvas_draw_rectangle (canvas, GIMP_CANVAS_STYLE_XOR, FALSE, - tx1 + 1, ty2 - height + 1, - tx2 - tx1 - 3, height - 3); + tx1 + top_and_bottom_handle_x_offset, + ty2 - height + 1, + width, height - 3); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx1 + top_and_bottom_handle_x_offset, + tx1 + top_and_bottom_handle_x_offset + 1, ty2 - 3, - tx1 + top_and_bottom_handle_x_offset, + tx1 + top_and_bottom_handle_x_offset + 1, ty2 - height + 1); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, - tx2 - top_and_bottom_handle_x_offset - 1, + tx1 + top_and_bottom_handle_x_offset + width - 1, ty2 - 3, - tx2 - top_and_bottom_handle_x_offset - 1, + tx1 + top_and_bottom_handle_x_offset + width - 1, ty2 - height + 1); break; case GTK_ANCHOR_WEST: gimp_canvas_draw_rectangle (canvas, GIMP_CANVAS_STYLE_XOR, FALSE, - tx1 + 1, ty1 + 1, - width - 2, ty2 - ty1 - 3); + tx1 + 1, + ty1 + left_and_right_handle_y_offset, + width - 3, height); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, tx1 + 2, - ty1 + left_and_right_handle_y_offset, - tx1 + width - 1, - ty1 + left_and_right_handle_y_offset); + ty1 + left_and_right_handle_y_offset + 1, + tx1 + width - 2, + ty1 + left_and_right_handle_y_offset + 1); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, tx1 + 2, - ty2 - left_and_right_handle_y_offset - 1, - tx1 + width - 1, - ty2 - left_and_right_handle_y_offset - 1); + ty1 + left_and_right_handle_y_offset + height - 1, + tx1 + width - 2, + ty1 + left_and_right_handle_y_offset + height - 1); break; case GTK_ANCHOR_EAST: gimp_canvas_draw_rectangle (canvas, GIMP_CANVAS_STYLE_XOR, FALSE, - tx2 - width + 1, ty1 + 1, - width - 3, ty2 - ty1 - 3); + tx2 - width + 1, + ty1 + left_and_right_handle_y_offset, + width - 3, height); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, tx2 - 3, - ty1 + left_and_right_handle_y_offset, + ty1 + left_and_right_handle_y_offset + 1, tx2 - width + 1, - ty1 + left_and_right_handle_y_offset); + ty1 + left_and_right_handle_y_offset + 1); gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_XOR, tx2 - 3, - ty2 - left_and_right_handle_y_offset - 1, + ty1 + left_and_right_handle_y_offset + height - 1, tx2 - width + 1, - ty2 - left_and_right_handle_y_offset - 1); + ty1 + left_and_right_handle_y_offset + height - 1); break; default: diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c index 9c82d0fed5..1eee3fb368 100644 --- a/app/tools/gimprectangletool.c +++ b/app/tools/gimprectangletool.c @@ -1651,32 +1651,37 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool) gimp_draw_tool_draw_corner (draw_tool, FALSE, private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->handle_h, + private->handle_w, + private->handle_h, GTK_ANCHOR_NORTH_WEST, FALSE); gimp_draw_tool_draw_corner (draw_tool, FALSE, private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->handle_h, + private->handle_w, + private->handle_h, GTK_ANCHOR_NORTH_EAST, FALSE); gimp_draw_tool_draw_corner (draw_tool, FALSE, private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->handle_h, + private->handle_w, + private->handle_h, GTK_ANCHOR_SOUTH_WEST, FALSE); gimp_draw_tool_draw_corner (draw_tool, FALSE, private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->handle_h, + private->handle_w, + private->handle_h, GTK_ANCHOR_SOUTH_EAST, FALSE); break; case RECT_RESIZING_TOP: case RECT_RESIZING_BOTTOM: gimp_draw_tool_draw_corner (draw_tool, - !gimp_tool_control_is_active (tool->control), + ! gimp_tool_control_is_active (tool->control), private->x1, private->y1, private->x2, private->y2, - private->top_and_bottom_handle_w, private->handle_h, + private->top_and_bottom_handle_w, + private->handle_h, gimp_rectangle_tool_get_anchor (private), FALSE); break; @@ -1684,20 +1689,22 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool) case RECT_RESIZING_LEFT: case RECT_RESIZING_RIGHT: gimp_draw_tool_draw_corner (draw_tool, - !gimp_tool_control_is_active (tool->control), + ! gimp_tool_control_is_active (tool->control), private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->left_and_right_handle_h, + private->handle_w, + private->left_and_right_handle_h, gimp_rectangle_tool_get_anchor (private), FALSE); break; default: gimp_draw_tool_draw_corner (draw_tool, - !gimp_tool_control_is_active (tool->control), + ! gimp_tool_control_is_active (tool->control), private->x1, private->y1, private->x2, private->y2, - private->handle_w, private->handle_h, + private->handle_w, + private->handle_h, gimp_rectangle_tool_get_anchor (private), FALSE); break;