X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_draw.cpp;fp=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_draw.cpp;h=04ed354fbe0b9678b2381da3cd7441eca6d647f3;hb=e60968bc7c0d22165469e9aa9512994f1a38e5bc;hp=b8c90f325318f3dff6be7ae580ed06545f9ff3a4;hpb=cf8349439dd89fa8a149283b00d525ebf96f1124;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_draw.cpp b/synfig-studio/trunk/src/gtkmm/state_draw.cpp index b8c90f3..04ed354 100644 --- a/synfig-studio/trunk/src/gtkmm/state_draw.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_draw.cpp @@ -115,6 +115,7 @@ class studio::StateDraw_Context : public sigc::trackable Duckmatic::Type old_duckmask; void fill_last_stroke(); + void fill_last_stroke_and_unselect_other_layers(); Smach::event_result new_bline(std::list bline,bool loop_bline_flag,float radius); @@ -764,6 +765,8 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_data, Smach::event_result StateDraw_Context::new_bline(std::list bline,bool loop_bline_flag,float radius) { + synfigapp::SelectionManager::LayerList layer_list = get_canvas_view()->get_selection_manager()->get_selected_layers(); + // Create the action group synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch BLine")); @@ -1025,7 +1028,7 @@ StateDraw_Context::new_bline(std::list bline,bool loop_bline // fill_last_stroke() will take care of clearing the selection if we're calling it if(get_outline_flag() && get_region_flag()) - fill_last_stroke(); + fill_last_stroke_and_unselect_other_layers(); else get_canvas_interface()->get_selection_manager()->clear_selected_layers(); @@ -1078,7 +1081,8 @@ StateDraw_Context::new_bline(std::list bline,bool loop_bline //refresh_ducks(); return Smach::RESULT_ERROR; } - get_canvas_view()->get_selection_manager()->set_selected_layer(layer); + layer_list.push_back(layer); + get_canvas_view()->get_selection_manager()->set_selected_layers(layer_list); //refresh_ducks(); } @@ -1933,7 +1937,7 @@ StateDraw_Context::reverse_bline(std::list &bline) } void -StateDraw_Context::fill_last_stroke() +StateDraw_Context::fill_last_stroke_and_unselect_other_layers() { if(!last_stroke) return; @@ -1982,3 +1986,14 @@ StateDraw_Context::fill_last_stroke() } get_canvas_view()->get_selection_manager()->set_selected_layer(layer); } + +void +StateDraw_Context::fill_last_stroke() +{ + if(!last_stroke) + return; + + synfigapp::SelectionManager::LayerList layer_list = get_canvas_view()->get_selection_manager()->get_selected_layers(); + fill_last_stroke_and_unselect_other_layers(); + get_canvas_view()->get_selection_manager()->set_selected_layers(layer_list); +}