From 96e8b93e2afc36de5d8accf6310f5f9820be6d69 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Sun, 27 Jun 2004 23:00:46 +0000 Subject: [PATCH] fixed drawing code to properly update after deleting nodes via 2004-06-28 Simon Budig * app/tools/gimpvectortool.c: fixed drawing code to properly update after deleting nodes via BackSpace/Delete. --- ChangeLog | 5 +++++ app/tools/gimpvectortool.c | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d573e3d3e8..26809309cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-28 Simon Budig + + * app/tools/gimpvectortool.c: fixed drawing code to properly + update after deleting nodes via BackSpace/Delete. + 2004-06-27 Bill Skaggs * app/tools/gimplevelstool.c: removed two small chunks of code. diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c index 2c65b7b5bf..11f9419407 100644 --- a/app/tools/gimpvectortool.c +++ b/app/tools/gimpvectortool.c @@ -1721,8 +1721,12 @@ gimp_vector_tool_delete_selected_anchors (GimpVectorTool *vector_tool) { GimpAnchor *cur_anchor; GimpStroke *cur_stroke = NULL; - GList *anchors; - GList *list; + GList *anchors; + GList *list; + gboolean have_undo = FALSE; + + gimp_draw_tool_pause (GIMP_DRAW_TOOL (vector_tool)); + gimp_vectors_freeze (vector_tool->vectors); while ((cur_stroke = gimp_vectors_stroke_get_next (vector_tool->vectors, cur_stroke))) @@ -1735,11 +1739,25 @@ gimp_vector_tool_delete_selected_anchors (GimpVectorTool *vector_tool) cur_anchor = GIMP_ANCHOR (list->data); if (cur_anchor->selected) - gimp_stroke_anchor_delete (cur_stroke, cur_anchor); + { + if (! have_undo) + { + gimp_vector_tool_undo_push (vector_tool, _("Delete Anchors")); + have_undo = TRUE; + } + + gimp_stroke_anchor_delete (cur_stroke, cur_anchor); + + if (gimp_stroke_is_empty (cur_stroke)) + gimp_vectors_stroke_remove (vector_tool->vectors, cur_stroke); + } } g_list_free (anchors); } + + gimp_vectors_thaw (vector_tool->vectors); + gimp_draw_tool_resume (GIMP_DRAW_TOOL (vector_tool)); } static void