From f317820b30937cc73cd1a213a22ade021c14af54 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 13 Apr 2008 19:56:03 +0000 Subject: [PATCH] Towards 1939884: "Exclude ducks linked to bline from selection by Ctrl+A". This patch excludes ducks from selection by Ctrl+A if the duck is a BLineCalcVertex or a tangent or width duck of a BLineCalcVertex duck. git-svn-id: http://svn.voria.com/code@2018 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/duckmatic.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 92675c8..fb14706 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -254,9 +254,10 @@ Duckmatic::is_duck_group_selectable(const etl::handle& 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& 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; } -- 2.7.4