From 30d736712404ceeff9971185a4355ac0328535f1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 16 Mar 2007 14:44:45 +0000 Subject: [PATCH] Fix 1438545: hide and reshow the sketch after 'undo' or 'clear' to ensure it's updated on screen. There may be a better way to do this; I've left that as a \todo in the code. git-svn-id: http://svn.voria.com/code@347 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/state_sketch.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp index ec6e840..32ab3d3 100644 --- a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp @@ -190,7 +190,15 @@ void StateSketch_Context::clear_sketch() { get_work_area()->clear_persistant_strokes(); - get_canvas_view()->get_smach().process_event(EVENT_REFRESH); + + // if the sketch is currently shown, make sure it is updated + //! \todo is there a better way than this of getting Duckmatic to update its stroke_list_? + if (checkbutton_show_sketch.get_active()) + { + get_work_area()->set_show_persistant_strokes(false); + get_work_area()->set_show_persistant_strokes(true); + get_canvas_view()->get_smach().process_event(EVENT_REFRESH); + } } void @@ -199,7 +207,15 @@ StateSketch_Context::undo_stroke() if(!get_work_area()->persistant_stroke_list().empty()) { get_work_area()->persistant_stroke_list().pop_back(); - get_canvas_view()->get_smach().process_event(EVENT_REFRESH); + + // if the sketch is currently shown, make sure it is updated + //! \todo is there a better way than this of getting Duckmatic to update its stroke_list_? + if (checkbutton_show_sketch.get_active()) + { + get_work_area()->set_show_persistant_strokes(false); + get_work_area()->set_show_persistant_strokes(true); + get_canvas_view()->get_smach().process_event(EVENT_REFRESH); + } } } -- 2.7.4