From 5700c67b01e3866ee94dffb378bd5b960e8ae176 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 2 Feb 2008 09:45:49 +0000 Subject: [PATCH] Don't hide the pending point line if we are grabbing the first point. 2008-02-02 Martin Nordholts * app/tools/gimppolygonselecttool.c (gimp_polygon_select_tool_oper_update): Don't hide the pending point line if we are grabbing the first point. (gimp_polygon_select_tool_motion): Also update the pending point if we are moving the first point. svn path=/trunk/; revision=24775 --- ChangeLog | 8 ++++++++ app/tools/gimppolygonselecttool.c | 28 +++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bc00be79f..2129d1fe14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-02 Martin Nordholts + + * app/tools/gimppolygonselecttool.c + (gimp_polygon_select_tool_oper_update): Don't hide the pending + point line if we are grabbing the first point. + (gimp_polygon_select_tool_motion): Also update the pending point + if we are moving the first point. + 2008-02-02 Martin Nordholts * app/tools/gimppolygonselecttool.c diff --git a/app/tools/gimppolygonselecttool.c b/app/tools/gimppolygonselecttool.c index 1dbecf478a..cea24b11f0 100644 --- a/app/tools/gimppolygonselecttool.c +++ b/app/tools/gimppolygonselecttool.c @@ -236,13 +236,20 @@ gimp_polygon_select_tool_oper_update (GimpTool *tool, if (tool->display == display) { + gboolean hovering_first_point; + gimp_polygon_select_tool_select_closet_point (poly_sel_tool, display, coords); + hovering_first_point = gimp_polygon_select_tool_should_close (poly_sel_tool, + display, + coords); + gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); - if (poly_sel_tool->grabbed_point || poly_sel_tool->num_points == 0) + if (poly_sel_tool->num_points == 0 || + (poly_sel_tool->grabbed_point && !hovering_first_point)) { poly_sel_tool->show_pending_point = FALSE; } @@ -250,8 +257,15 @@ gimp_polygon_select_tool_oper_update (GimpTool *tool, { poly_sel_tool->show_pending_point = TRUE; - poly_sel_tool->pending_point.x = coords->x; - poly_sel_tool->pending_point.y = coords->y; + if (hovering_first_point) + { + poly_sel_tool->pending_point = poly_sel_tool->points[0]; + } + else + { + poly_sel_tool->pending_point.x = coords->x; + poly_sel_tool->pending_point.y = coords->y; + } } gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); @@ -299,6 +313,14 @@ gimp_polygon_select_tool_motion (GimpTool *tool, { poly_sel_tool->grabbed_point->x = coords->x; poly_sel_tool->grabbed_point->y = coords->y; + + if (gimp_polygon_select_tool_should_close (poly_sel_tool, + display, + coords)) + { + poly_sel_tool->pending_point.x = coords->x; + poly_sel_tool->pending_point.y = coords->y; + } } else {