From: dooglus Date: Wed, 20 Feb 2008 16:13:39 +0000 (+0000) Subject: Simplify the code. There's no need to check whether we're increasing or decreasing... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5191f9f9c8a40f70a7e2a7ef1dc99264359c6ec2;p=synfig.git Simplify the code. There's no need to check whether we're increasing or decreasing the amount; we already know. git-svn-id: http://svn.voria.com/code@1790 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp b/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp index 321a069..5b7834c 100644 --- a/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp @@ -491,21 +491,14 @@ LayerActionManager::amount_inc() float adjust(0.1); // Create the action group - synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); - - if(adjust>0) - group.set_name(_("Increase Amount")); - + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Increase Amount")); synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); - while(!layer_list.empty()) + for (; !layer_list.empty(); layer_list.pop_front()) { ValueBase value(layer_list.front()->get_param("amount")); if(value.same_type_as(Real())) - { get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); - } - layer_list.pop_front(); } } @@ -516,19 +509,12 @@ LayerActionManager::amount_dec() // Create the action group synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); - - if(adjust>0) - group.set_name(_("Increase Amount")); - synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); - while(!layer_list.empty()) + for (; !layer_list.empty(); layer_list.pop_front()) { ValueBase value(layer_list.front()->get_param("amount")); if(value.same_type_as(Real())) - { get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); - } - layer_list.pop_front(); } }