From: Genete <ge...@us...> - 2009-07-31 00:05:49
|
Module: synfig Branch: genete_width_points Commit: a8c4049af24cca2e7b76c0fe14605a0b39e1b883 URL: http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=a8c4049af24cca2e7b76c0fe14605a0b39e1b883 Author: Carlos Lopez <carlos@pcnuevo.(none)> Date: Fri Jul 31 02:04:28 2009 +0200 Create proper composite valuenodes and teach cellrenderer to show the proper name of the wline --- .../trunk/src/gtkmm/cellrenderer_value.cpp | 3 +++ .../trunk/src/synfigapp/actions/valuedescset.cpp | 9 +++++++++ .../trunk/src/synfigapp/canvasinterface.cpp | 12 +++++++++++- 3 files changed, 23 insertions(+), 1 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp index 456dee7..e460971 100644 --- a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp +++ b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp @@ -450,6 +450,9 @@ CellRenderer_ValueBase::render_vfunc( case ValueBase::TYPE_BLINEPOINT: property_text()=(Glib::ustring)_("BLine Point"); break; + case ValueBase::TYPE_WLINEPOINT: + property_text()=(Glib::ustring)_("WLine Point"); + break; default: property_text()=static_cast<Glib::ustring>(_("UNKNOWN")); break; diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp index e3959ce..ad6f54c 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp @@ -258,6 +258,15 @@ Action::ValueDescSet::prepare() n_components=6; break; } + case ValueBase::TYPE_WLINEPOINT: + { + WLinePoint wline_point(value); + components[0]=wline_point.get_position(); + components[1]=wline_point.get_width(); + components[2]=wline_point.get_origin(); + n_components=3; + break; + } default: throw Error(_("Bad type for composite (%s)"),ValueBase::type_local_name(value.get_type()).c_str()); break; diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index bd7766f..921ee4f 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -42,6 +42,7 @@ #include <synfig/valuenode_twotone.h> #include <synfig/valuenode_stripes.h> #include <synfig/valuenode_bline.h> +#include <synfig/valuenode_wline.h> #include <synfig/waypoint.h> #include <synfig/loadcanvas.h> @@ -243,7 +244,7 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas // bline if(iter->second.get_type()==ValueBase::TYPE_LIST) { - // check whether it's a list of blinepoints only + // check whether it's a list of blinepoints or wlinepoints only vector<ValueBase> list(iter->second.get_list()); if (list.size()) { @@ -256,6 +257,15 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas value_node=LinkableValueNode::create("bline",iter->second); ValueNode_BLine::Handle::cast_dynamic(value_node)->set_member_canvas(canvas); } + vector<ValueBase>::iterator iter3; + for (iter3 = list.begin(); iter3 != list.end(); iter3++) + if (iter3->get_type() != ValueBase::TYPE_WLINEPOINT) + break; + if (iter3 == list.end()) + { + value_node=LinkableValueNode::create("wline",iter->second); + ValueNode_WLine::WHandle::cast_dynamic(value_node)->set_member_canvas(canvas); + } } if (!value_node) |