X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_smoothmove.cpp;h=56ca977e768f93dfd42501d76c6fe6bdb45b3975;hb=990f7bb7694e0472ed6ad165e0724864539071cd;hp=dbd2a2490c75bc9a0e0050c652b63df8b53b0b15;hpb=c6af6e1c3816eb3b15c573089b32e6ae65cd2f49;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp index dbd2a24..56ca977 100644 --- a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp @@ -2,10 +2,11 @@ /*! \file state_smoothmove.cpp ** \brief Template File ** -** $Id: state_smoothmove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \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 @@ -50,6 +51,8 @@ #include "onemoment.h" #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -171,10 +174,9 @@ StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): pressure=1.0f; // Set up the tool options dialog - //options_table.attach(*manage(new Gtk::Label(_("SmoothMove Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - - options_table.attach(*manage(new Gtk::Label(_("Radius"))), 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - options_table.attach(spin_radius, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + options_table.attach(*manage(new Gtk::Label(_("SmoothMove Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + options_table.attach(*manage(new Gtk::Label(_("Radius"))), 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + options_table.attach(spin_radius, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); spin_radius.signal_value_changed().connect(sigc::mem_fun(*this,&StateSmoothMove_Context::refresh_radius)); @@ -183,7 +185,7 @@ StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): //App::dialog_tool_options->set_widget(options_table); App::dialog_tool_options->present(); - get_work_area()->allow_layer_clicks=true; + get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); App::toolbox->refresh(); @@ -204,7 +206,7 @@ StateSmoothMove_Context::refresh_tool_options() } Smach::event_result -StateSmoothMove_Context::event_refresh_tool_options(const Smach::event& x) +StateSmoothMove_Context::event_refresh_tool_options(const Smach::event& /*x*/) { refresh_tool_options(); return Smach::RESULT_ACCEPT; @@ -260,9 +262,13 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto int i; + // process vertex and position ducks first for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { - if(((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue; + // skip this duck if it is NOT a vertex or a position + if (((*iter)->get_type() != Duck::TYPE_VERTEX && + (*iter)->get_type() != Duck::TYPE_POSITION)) + continue; Point p(positions[i]); float dist(1.0f-(p-drag_offset_).mag()/get_radius()); @@ -273,9 +279,13 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto (*iter)->set_trans_point(p+last_[i]); } + // then process non vertex and non position ducks for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++) { - if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue; + // skip this duck if it IS a vertex or a position + if (!((*iter)->get_type() != Duck::TYPE_VERTEX && + (*iter)->get_type() != Duck::TYPE_POSITION)) + continue; Point p(positions[i]); float dist(1.0f-(p-drag_offset_).mag()/get_radius());