From b9afb940c29c1713ea1bdc5b152b26f2ff7a88cc Mon Sep 17 00:00:00 2001 From: "Garry R. Osgood" Date: Sun, 2 Apr 2000 01:33:26 +0000 Subject: [PATCH] gimp/app/bezier_select.c No fooling, #6903 was not that hard to close; in 2000-04-01 Garry R. Osgood * gimp/app/bezier_select.c No fooling, #6903 was not that hard to close; in bezier_edit_point_on_curve(),when point deletion reduces a curve below the minimum with which the implementation can cope (2 anchors, four controls) we put it out of its misery with an invocation of delete_whole_curve(). --- ChangeLog | 10 ++++++++++ app/bezier_select.c | 24 +++++++++++------------- app/tools/bezier_select.c | 24 +++++++++++------------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 853b9fb813..88397175e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-04-01 Garry R. Osgood + * app/bezier_select.c + When user deletion of anchor points decimates a curve + below the number which the implementation can properly + manipulate, bezier_edit_point_on_curve() now invokes + delete_whole_curve(). Formerly returned a zero, prompting + a mode change and a re-interpretation of the mouse-button-down + event as the addition of a new curve segment, giving + rise to #6093. Closes #6093. + 2000-04-01 Michael Natterer * app/disp_callbacks.c: when dropping a drawable, do the diff --git a/app/bezier_select.c b/app/bezier_select.c index 7dab955f3f..5b66a18320 100644 --- a/app/bezier_select.c +++ b/app/bezier_select.c @@ -630,20 +630,18 @@ bezier_edit_point_on_curve(int x, if (ModeEdit== EXTEND_REMOVE) { - if(bevent->state & GDK_SHIFT_MASK) + if((bevent->state & GDK_SHIFT_MASK) || (point_counts <= 7)) { - delete_whole_curve(bezier_sel,start_pt); - } - else if (point_counts <= 7) - { - /* If we've got less then 7 points ie: 2 anchors points 4 controls - Then the curve is minimal closed curve. - I've decided to not operate on this kind of curve because it - implies opening the curve and change some drawing states - Removing 1 point of curve that contains 2 point is something - similare to reconstruct the curve !!! + /* Case 1: GDK_SHIFT_MASK - The user explicitly wishes the present + curve to go away. + Case 2: The current implementation cannot cope with less than + 7 points ie: 2 anchors points and 4 controls: the minimal closed curve. + Since the user wishes less than this implementation minimum, + we take this for an implicit wish that the entire curve go away. + G'bye dear curve. */ - return(0); + + delete_whole_curve(bezier_sel,start_pt); } else if(!finded->prev || !finded->prev->prev) { @@ -1627,7 +1625,7 @@ bezier_select_cursor_update (Tool *tool, if (on_control_pnt && mevent->state & GDK_SHIFT_MASK) { gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_SUBTRACT_CURSOR); - g_print ("delete whole curve cursor\n"); +/* g_print ("delete whole curve cursor\n"); */ } else if (on_control_pnt) { diff --git a/app/tools/bezier_select.c b/app/tools/bezier_select.c index 7dab955f3f..5b66a18320 100644 --- a/app/tools/bezier_select.c +++ b/app/tools/bezier_select.c @@ -630,20 +630,18 @@ bezier_edit_point_on_curve(int x, if (ModeEdit== EXTEND_REMOVE) { - if(bevent->state & GDK_SHIFT_MASK) + if((bevent->state & GDK_SHIFT_MASK) || (point_counts <= 7)) { - delete_whole_curve(bezier_sel,start_pt); - } - else if (point_counts <= 7) - { - /* If we've got less then 7 points ie: 2 anchors points 4 controls - Then the curve is minimal closed curve. - I've decided to not operate on this kind of curve because it - implies opening the curve and change some drawing states - Removing 1 point of curve that contains 2 point is something - similare to reconstruct the curve !!! + /* Case 1: GDK_SHIFT_MASK - The user explicitly wishes the present + curve to go away. + Case 2: The current implementation cannot cope with less than + 7 points ie: 2 anchors points and 4 controls: the minimal closed curve. + Since the user wishes less than this implementation minimum, + we take this for an implicit wish that the entire curve go away. + G'bye dear curve. */ - return(0); + + delete_whole_curve(bezier_sel,start_pt); } else if(!finded->prev || !finded->prev->prev) { @@ -1627,7 +1625,7 @@ bezier_select_cursor_update (Tool *tool, if (on_control_pnt && mevent->state & GDK_SHIFT_MASK) { gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_SUBTRACT_CURSOR); - g_print ("delete whole curve cursor\n"); +/* g_print ("delete whole curve cursor\n"); */ } else if (on_control_pnt) {