gimp/app/bezier_select.c No fooling, #6903 was not that hard to close; in

2000-04-01 Garry R. Osgood <gosgood@idt.net>

* 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().
This commit is contained in:
Garry R. Osgood 2000-04-02 01:33:26 +00:00 committed by Garry R. Osgood
parent 902aea45e9
commit b9afb940c2
3 changed files with 32 additions and 26 deletions

View File

@ -1,3 +1,13 @@
2000-04-01 Garry R. Osgood <gosgood@idt.net>
* 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 <mitch@gimp.org>
* app/disp_callbacks.c: when dropping a drawable, do the

View File

@ -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)
{

View File

@ -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)
{