From: dooglus Date: Wed, 13 Feb 2008 11:53:12 +0000 (+0000) Subject: In the draw tool, if the user draws a very quick stroke (such that 6 or less points... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4175bef7c1586386c83011120c1b63273f841352;p=synfig.git In the draw tool, if the user draws a very quick stroke (such that 6 or less points are collected) the stroke isn't used. Previously, the stroke was left as a thin line in the workarea until a longer stroke was completed successfully. This was probably a bug rather than a feature, but could possible have been intended, as a strange and temporary alternative to the sketch tool. This change clears each stroke whether it is long enough to be used or not. To restore the previous behaviour, set environment variable SYNFIG_KEEP_ABORTED_DRAW_LINES. git-svn-id: http://svn.voria.com/code@1689 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/state_draw.cpp b/synfig-studio/trunk/src/gtkmm/state_draw.cpp index 9f7f823..6122064 100644 --- a/synfig-studio/trunk/src/gtkmm/state_draw.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_draw.cpp @@ -755,8 +755,15 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_data, } // If the bline only has one blinepoint, then there is nothing to do. - if(bline.size()<=1) + if(bline.size() < 2) + { + // hide the 'stroke' line we were drawing, unless the user + // explicitly requests that they are kept + if (!getenv("SYNFIG_KEEP_ABORTED_DRAW_LINES")) + refresh_ducks(); + return Smach::RESULT_OK; + } if(region_flag) return new_region(bline,radius);