Duckmatic::Type old_duckmask;
- void fill_last_stroke(int depth_offset);
+ void fill_last_stroke();
Smach::event_result new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline_flag,float radius);
//options_table.attach(button_fill_last_stroke, 0, 2, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- button_fill_last_stroke.signal_pressed().connect(sigc::bind(sigc::mem_fun(*this,&StateDraw_Context::fill_last_stroke), 0));
+ button_fill_last_stroke.signal_pressed().connect(sigc::mem_fun(*this,&StateDraw_Context::fill_last_stroke));
check_localerror.signal_toggled().connect(sigc::mem_fun(*this,&StateDraw_Context::UpdateErrorBox));
options_table.show_all();
Gtk::StockID("synfig-fill"),
_("Fill Last Stroke")
)->signal_clicked().connect(
- sigc::bind(
- sigc::mem_fun(
- *this,
- &StateDraw_Context::fill_last_stroke),
- 0));
+ sigc::mem_fun(
+ *this,
+ &StateDraw_Context::fill_last_stroke));
}
Smach::event_result
}
}
- // Create the layer
+ last_stroke=value_node;
+ last_stroke_id=get_id();
+
{
+ // Create the layer(s)
Layer::Handle layer;
Canvas::Handle canvas(get_canvas_view()->get_canvas());
int depth(0);
depth=layer->get_depth();
canvas=layer->get_canvas();
}
- get_canvas_interface()->get_selection_manager()->clear_selected_layers();
+
+ // 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();
+ else
+ get_canvas_interface()->get_selection_manager()->clear_selected_layers();
//int number(synfig::UniqueID().get_uid());
//refresh_ducks();
}
- last_stroke=value_node;
- last_stroke_id=get_id();
-
- if(get_outline_flag() && get_region_flag())
- fill_last_stroke(1);
-
increment_id();
return Smach::RESULT_ACCEPT;
}
}
void
-StateDraw_Context::fill_last_stroke(int depth_offset)
+StateDraw_Context::fill_last_stroke()
{
if(!last_stroke)
return;
layer=get_canvas_view()->get_selection_manager()->get_selected_layer();
if(layer)
{
- depth=layer->get_depth() + depth_offset;
+ depth=layer->get_depth();
canvas=layer->get_canvas();
}
+ get_canvas_interface()->get_selection_manager()->clear_selected_layers();
layer=get_canvas_interface()->add_layer_to("region", canvas, depth);
assert(layer);
layer->set_param("color",synfigapp::Main::get_background_color());