From: Carlos Lopez Date: Sat, 4 Sep 2010 09:56:58 +0000 (+0200) Subject: Fix the bug mentioned in the previous commit. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0d56be650c43312c9466a309f86987bf8fd90fa0;p=synfig.git Fix the bug mentioned in the previous commit. Now if tangent(s) is(are) animated then the the with more waypoints is preserved. TODO: fix the normal Link action --- diff --git a/synfig-studio/src/synfigapp/actions/valuedescsmartlink.cpp b/synfig-studio/src/synfigapp/actions/valuedescsmartlink.cpp index d584504..a531a11 100644 --- a/synfig-studio/src/synfigapp/actions/valuedescsmartlink.cpp +++ b/synfig-studio/src/synfigapp/actions/valuedescsmartlink.cpp @@ -213,6 +213,24 @@ Action::ValueDescSmartLink::set_param(const synfig::String& name, const Action:: status_message = _("There's a tie for most referenced, and both are animated; using the one with the most waypoints."); } } + else if(LinkableValueNode::Handle::cast_dynamic(link_value_node) && + LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()) && + LinkableValueNode::Handle::cast_dynamic(link_value_node)->get_times().size() != + LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node())->get_times().size()) + { + if(LinkableValueNode::Handle::cast_dynamic(link_value_node)->get_times().size() < + LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node())->get_times().size()) + { + status_level = 4; + status_message = _("There's a tie for most referenced, and both are linkable value node animated; using the one with the most waypoints."); + link_value_node=value_desc.get_value_node(); + } + else if (status_level <= 4) + { + status_level = 4; + status_message = _("There's a tie for most referenced, and both are linkable value node animated; using the one with the most waypoints."); + } + } // Use the one that was least recently changed else if(link_value_node->get_time_last_changed()!=value_desc.get_value_node()->get_time_last_changed()) {