Towards 1939884: "Exclude ducks linked to bline from selection by Ctrl+A". This...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 13 Apr 2008 19:56:03 +0000 (19:56 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 13 Apr 2008 19:56:03 +0000 (19:56 +0000)
git-svn-id: http://svn.voria.com/code@2018 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/duckmatic.cpp

index 92675c8..fb14706 100644 (file)
@@ -254,9 +254,10 @@ Duckmatic::is_duck_group_selectable(const etl::handle<Duck>& x)const
                 !x->get_editable()))
                return false;
 
-       if(x->get_value_desc().parent_is_layer_param() && type & Duck::TYPE_POSITION)
+       synfigapp::ValueDesc value_desc(x->get_value_desc());
+       if(value_desc.parent_is_layer_param() && type & Duck::TYPE_POSITION)
        {
-               Layer::Handle layer(x->get_value_desc().get_layer());
+               Layer::Handle layer(value_desc.get_layer());
                String layer_name(layer->get_name());
 
                if (layer_name == "outline" || layer_name == "region" || layer_name == "plant" ||
@@ -267,6 +268,21 @@ Duckmatic::is_duck_group_selectable(const etl::handle<Duck>& x)const
                   !layer->get_param("children_lock").get(bool()))
                        return false;
        }
+       else if (value_desc.parent_is_value_node())
+       {
+               if (ValueNode_BLineCalcVertex::Handle::cast_dynamic(value_desc.get_value_node()))
+                       return false;
+               if (value_desc.parent_is_linkable_value_node())
+               {
+                       LinkableValueNode::Handle parent_value_node(value_desc.get_parent_value_node());
+                       if (ValueNode_Composite::Handle::cast_dynamic(parent_value_node) &&
+                               parent_value_node->get_type() == ValueBase::TYPE_BLINEPOINT &&
+                               ValueNode_BLineCalcVertex::Handle::cast_dynamic(
+                                       synfigapp::ValueDesc(parent_value_node,
+                                                                                parent_value_node->get_link_index_from_name("point")).get_value_node()))
+                               return false;
+               }
+       }
        return true;
 }