#include <gtkmm/scale.h>
#include <sigc++/connection.h>
+#include "general.h"
+
#endif
/* === U S I N G =========================================================== */
bool prev_workarea_layer_status_;
int nested;
- SigC::Connection process_queue_connection;
+ sigc::connection process_queue_connection;
ValueNode_BLine::Handle last_stroke;
synfig::String last_stroke_id;
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;
}
if(value_prev.get_parent_value_node()==value_next.get_parent_value_node() &&
value_prev.get_parent_value_node()!=value_desc.get_parent_value_node())
{
- DEBUGPOINT();
vertex_list.erase(iter);
done=false;
break;
// if(value_prev.get_value_node()==value_desc.get_value_node() ||
// value_desc.get_value_node()==value_next.get_value_node())
// {
- // // DEBUGPOINT();
// vertex_list.erase(iter);
// done=false;
// printf("erased node - i = %d\n", i);
// // if previous is the same as next, remove previous? or next?
// if(value_prev.get_value_node()==value_next.get_value_node())
// {
- // // DEBUGPOINT();
// vertex_list.erase(next);
// // vertex_list.erase(prev);
// done=false;
// strprintf("same parent, different points this %d < next-1 %d",
// value_desc.get_index(), ((value_next.get_index()-1))),
// current);
- // // DEBUGPOINT();
// for (int index = value_desc.get_index()+1; index < value_next.get_index(); index++)
// {
// printf("inserting up %d\n", index);
// strprintf("same parent, different points next %d < this-1 %d",
// value_next.get_index(), ((value_desc.get_index()-1))),
// current);
- // // DEBUGPOINT();
// for (int index = value_desc.get_index()-1; index > value_next.get_index(); index--)
// {
// printf("inserting down %d\n", index);
if((vertex.get_vertex()-vertex_next.get_vertex()).mag_squared()<radius*radius)
{
printf("in one - it's close\n");
- // DEBUGPOINT();
ValueNode_Composite::Handle value_node;
ValueNode_Composite::Handle value_node_next;
value_node=ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node().clone());
synfig::info(__FILE__":%d: Unable to properly connect blines.",__LINE__);
continue;
}
- // DEBUGPOINT();
// \todo if next isn't split, don't we want to copy its 'Tangent 1' instead?
value_node->set_link(5,value_node_next->get_link(5)); // Tangent 2
value_node->set_link(3,ValueNode_Const::create(true)); // Split Tangents
else if (value_prev.parent_is_value_node())
{
printf("in two - it's far\n");
- // DEBUGPOINT();
// \todo this only makes sense if prev is on the same bline
printf("this is index %d\n", value_desc.get_index());
printf("prev is index %d\n", value_prev.get_index());
if (value_desc.get_index()<LinkableValueNode::Handle::cast_static(value_desc.get_parent_value_node())->link_count()-1)
{
printf("in two - b\n");
- // DEBUGPOINT();
printf("inserting node with index %d\n", value_desc.get_index()+1);
vertex_list.insert(next,
synfigapp::ValueDesc(value_desc.get_parent_value_node(),
if(value_desc.get_index()>0)
{
printf("in two - a\n");
- // DEBUGPOINT();
printf("inserting node on this line with index %d\n",
value_desc.get_index()-1);
vertex_list.insert(next,
}
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());