From 4105b5d61d5145f737d1603263c0a0292df22407 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 15 Feb 2008 13:55:18 +0000 Subject: [PATCH] Show width ducks for exported blines. git-svn-id: http://svn.voria.com/code@1696 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/duckmatic.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index bbf6f74..b470816 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -1516,8 +1516,9 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleget_hint().empty()) + // Add the width duck if it is a parameter with a hint (ie. "width") or if it isn't a parameter + if ((param_desc && !param_desc->get_hint().empty()) || + !param_desc) { etl::handle width; if(add_to_ducks(synfigapp::ValueDesc(vertex_value_node,1),canvas_view,transform_stack,REAL_COOKIE)) @@ -1526,11 +1527,17 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_origin(duck); width->set_type(Duck::TYPE_WIDTH); width->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".w"); + + // if the bline is a layer's parameter, scale the width duck by the layer's "width" parameter + if (param_desc) { ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_hint()).get_value(get_time())); if(value.same_type_as(synfig::Real())) width->set_scalar(value.get(synfig::Real())*0.5f); } + // otherwise just present the raw unscaled width + else + width->set_scalar(0.5f); } else synfig::error("Unable to add width duck!"); -- 2.7.4