X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_draw.cpp;h=063b3a7d36874b0efa9a291c42529f6ffdfdb621;hb=df278fa75371d2787391b98ee2ece48b307c8278;hp=9f7f8230d58355888d5a6ef016481e86b1c0407a;hpb=be371b33179c1dbd53ef59b3d060f533024ea317;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_draw.cpp b/synfig-studio/trunk/src/gtkmm/state_draw.cpp index 9f7f823..063b3a7 100644 --- a/synfig-studio/trunk/src/gtkmm/state_draw.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_draw.cpp @@ -377,7 +377,7 @@ StateDraw_Context::increment_id() String str_number; str_number=String(id,id.size()-digits,id.size()); id=String(id,0,id.size()-digits); - synfig::info("---------------- \"%s\"",str_number.c_str()); + // synfig::info("---------------- \"%s\"",str_number.c_str()); number=atoi(str_number.c_str()); } @@ -425,8 +425,6 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view): check_localerror(_("LocalError")) { - synfig::info("STATE SKETCH: entering state"); - nested=0; load_settings(); @@ -755,8 +753,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); @@ -929,6 +934,11 @@ StateDraw_Context::new_bline(std::list bline,bool loop_bline trans_bline.push_back(bline_point); } value_node=ValueNode_BLine::create(synfig::ValueBase(trans_bline,loop_bline_flag)); + + Canvas::Handle canvas(get_canvas_view()->get_canvas()); + Layer::Handle layer(get_canvas_view()->get_selection_manager()->get_selected_layer()); + if (layer) canvas=layer->get_canvas(); + value_node->set_member_canvas(canvas); } Smach::event_result result; @@ -999,8 +1009,7 @@ StateDraw_Context::new_bline(std::list bline,bool loop_bline LinkableValueNode::Handle::cast_dynamic(value_node->list.back().value_node)-> set_link(0,finish_duck_value_desc.get_value_node()); - if(get_auto_export_flag()) { - printf("this is where we would export the new line\n"); + if(get_auto_export_flag()) if (!get_canvas_interface()->add_value_node(value_node,get_id())) { /* it's no big deal, is it? let's keep the shape anyway */ @@ -1009,7 +1018,6 @@ StateDraw_Context::new_bline(std::list bline,bool loop_bline // increment_id(); // return Smach::RESULT_ERROR; } - } last_stroke=value_node; last_stroke_id=get_id();