{
const Type type(get_type_mask());
- if(( x->get_type() && (!(type & x->get_type())) ) )
+ if(( x->get_type() && (!(type & x->get_type())) || !x->get_editable() ) )
return false;
if(x->get_value_desc().parent_is_layer_param() && type & Duck::TYPE_POSITION)
{
const Duck::Handle& duck(iter->second);
- if(!duck->get_editable())
+ if(duck->get_ignore())
continue;
Real dist((duck->get_trans_point()-point).mag_squared());
if(duck->get_type()&Duck::TYPE_VERTEX)
dist*=1.0001;
+ else if(duck->get_type()&Duck::TYPE_RADIUS)
+ dist*=0.9999;
if(dist<=closest && !( duck->get_type() && (!(type & duck->get_type())) ) )
{
// add_duck(duck);
}
- // Add the width duck only if we have a hint of scale
- if(param_desc && !param_desc->get_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<Duck> width;
if(add_to_ducks(synfigapp::ValueDesc(vertex_value_node,1),canvas_view,transform_stack,REAL_COOKIE))
width->set_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);
+ // if it doesn't have a "width" parameter, scale by 0.5f instead
+ else
+ width->set_scalar(0.5f);
}
+ // otherwise just present the raw unscaled width
+ else
+ width->set_scalar(0.5f);
}
else
synfig::error("Unable to add width duck!");