Allow sub parameters of Linkable Value Nodes to have the static option.
authorCarlos Lopez <genetita@gmail.com>
Mon, 30 Aug 2010 19:45:33 +0000 (21:45 +0200)
committerCarlos Lopez <genetita@gmail.com>
Mon, 30 Aug 2010 19:45:33 +0000 (21:45 +0200)
synfig-studio/src/synfigapp/actions/valuenodeconstsetstatic.cpp
synfig-studio/src/synfigapp/actions/valuenodeconstunsetstatic.cpp

index d7c6d6a..1699673 100644 (file)
@@ -85,8 +85,8 @@ Action::ValueNodeConstSetStatic::is_candidate(const ParamList &x)
        ValueNode::Handle value_node;
        ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
 
-       if(value_desc.parent_is_value_node())
-               value_node = value_desc.get_parent_value_node();
+       if(value_desc.parent_is_value_node_const() || value_desc.parent_is_linkable_value_node())
+               value_node = value_desc.get_value_node();
        else
                value_node = x.find("value_node")->second.get_value_node();
 
@@ -107,7 +107,7 @@ Action::ValueNodeConstSetStatic::set_param(const synfig::String& name, const Act
                if(!value_desc.parent_is_value_node())
                        return false;
 
-               value_node=ValueNode_Const::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               value_node=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node());
 
                if(!value_node)
                        return false;
index c94bff1..e26dee4 100644 (file)
@@ -85,8 +85,8 @@ Action::ValueNodeConstUnSetStatic::is_candidate(const ParamList &x)
        ValueNode::Handle value_node;
        ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
 
-       if(value_desc.parent_is_value_node())
-               value_node = value_desc.get_parent_value_node();
+       if(value_desc.parent_is_value_node_const() || value_desc.parent_is_linkable_value_node())
+               value_node = value_desc.get_value_node();
        else
                value_node = x.find("value_node")->second.get_value_node();
 
@@ -107,7 +107,7 @@ Action::ValueNodeConstUnSetStatic::set_param(const synfig::String& name, const A
                if(!value_desc.parent_is_value_node())
                        return false;
 
-               value_node=ValueNode_Const::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               value_node=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node());
 
                if(!value_node)
                        return false;