From 5191f9f9c8a40f70a7e2a7ef1dc99264359c6ec2 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 20 Feb 2008 16:13:39 +0000 Subject: [PATCH] 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 --- synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) 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(); } } -- 2.7.4