projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Automatically export the Index parameter of new Duplicate layers.
[synfig.git]
/
synfig-studio
/
trunk
/
src
/
gtkmm
/
state_draw.cpp
diff --git
a/synfig-studio/trunk/src/gtkmm/state_draw.cpp
b/synfig-studio/trunk/src/gtkmm/state_draw.cpp
index
1b68e0f
..
a3d8855
100644
(file)
--- a/
synfig-studio/trunk/src/gtkmm/state_draw.cpp
+++ b/
synfig-studio/trunk/src/gtkmm/state_draw.cpp
@@
-62,6
+62,8
@@
#include <gtkmm/scale.h>
#include <sigc++/connection.h>
#include <gtkmm/scale.h>
#include <sigc++/connection.h>
+#include "general.h"
+
#endif
/* === U S I N G =========================================================== */
#endif
/* === U S I N G =========================================================== */
@@
-97,7
+99,7
@@
class studio::StateDraw_Context : public sigc::trackable
bool prev_workarea_layer_status_;
int nested;
bool prev_workarea_layer_status_;
int nested;
-
SigC::C
onnection process_queue_connection;
+
sigc::c
onnection process_queue_connection;
ValueNode_BLine::Handle last_stroke;
synfig::String last_stroke_id;
ValueNode_BLine::Handle last_stroke;
synfig::String last_stroke_id;
@@
-112,7
+114,7
@@
class studio::StateDraw_Context : public sigc::trackable
Duckmatic::Type old_duckmask;
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);
Smach::event_result new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline_flag,float radius);
@@
-448,7
+450,7
@@
StateDraw_Context::StateDraw_Context(CanvasView* canvas_view):
//options_table.attach(button_fill_last_stroke, 0, 2, 13, 14, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
//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();
check_localerror.signal_toggled().connect(sigc::mem_fun(*this,&StateDraw_Context::UpdateErrorBox));
options_table.show_all();
@@
-519,11
+521,9
@@
StateDraw_Context::refresh_tool_options()
Gtk::StockID("synfig-fill"),
_("Fill Last Stroke")
)->signal_clicked().connect(
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
}
Smach::event_result
@@
-1001,8
+1001,11
@@
StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline
}
}
}
}
- // 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);
Layer::Handle layer;
Canvas::Handle canvas(get_canvas_view()->get_canvas());
int depth(0);
@@
-1014,7
+1017,12
@@
StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline
depth=layer->get_depth();
canvas=layer->get_canvas();
}
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());
//int number(synfig::UniqueID().get_uid());
@@
-1069,12
+1077,6
@@
StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline
//refresh_ducks();
}
//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;
}
increment_id();
return Smach::RESULT_ACCEPT;
}
@@
-1932,7
+1934,7
@@
StateDraw_Context::reverse_bline(std::list<synfig::BLinePoint> &bline)
}
void
}
void
-StateDraw_Context::fill_last_stroke(
int depth_offset
)
+StateDraw_Context::fill_last_stroke()
{
if(!last_stroke)
return;
{
if(!last_stroke)
return;
@@
-1951,10
+1953,11
@@
StateDraw_Context::fill_last_stroke(int depth_offset)
layer=get_canvas_view()->get_selection_manager()->get_selected_layer();
if(layer)
{
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();
}
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());
layer=get_canvas_interface()->add_layer_to("region", canvas, depth);
assert(layer);
layer->set_param("color",synfigapp::Main::get_background_color());