X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Factivepointseton.cpp;h=f0384485f24c73cb5fe04534626d877bd0843189;hb=e1f3cb22be90099ebb28f2638cf0472ff93486c1;hp=3f48f05952b883430ab256942ec89bbbb3b7108d;hpb=8ef042c40521681cea99944097c4f90a5ac6cf74;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp index 3f48f05..f038448 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -53,7 +54,7 @@ using namespace Action; /* === M A C R O S ========================================================= */ ACTION_INIT(Action::ActivepointSetOn); -ACTION_SET_NAME(Action::ActivepointSetOn,"activepoint_set_on"); +ACTION_SET_NAME(Action::ActivepointSetOn,"ActivepointSetOn"); ACTION_SET_LOCAL_NAME(Action::ActivepointSetOn,N_("Mark Activepoint as \"On\"")); ACTION_SET_TASK(Action::ActivepointSetOn,"set_on"); ACTION_SET_CATEGORY(Action::ActivepointSetOn,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC); @@ -99,22 +100,22 @@ Action::ActivepointSetOn::get_param_vocab() bool Action::ActivepointSetOn::is_candidate(const ParamList &x) { - if(candidate_check(get_param_vocab(),x)) - { - ValueDesc value_desc(x.find("value_desc")->second.get_value_desc()); - if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())) - return false; + if (!candidate_check(get_param_vocab(),x)) + return false; - // We are only a candidate if this canvas is animated. - Canvas::Handle canvas(x.find("canvas")->second.get_canvas()); - if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end()) - return false; + ValueDesc value_desc(x.find("value_desc")->second.get_value_desc()); - // We need either a activepoint or a time. - if(x.count("activepoint") || x.count("time")) - return true; - } - return false; + if (!(value_desc.parent_is_value_node() && + // We need a dynamic list. + ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))) + return false; + + Canvas::Handle canvas(x.find("canvas")->second.get_canvas()); + + // We are only a candidate if this canvas is animated. + return (canvas->rend_desc().get_time_start() != canvas->rend_desc().get_time_end() && + // We need either an activepoint or a time. + (x.count("activepoint") || x.count("time"))); } bool