Improve the logic for when to use the tile renderer. At lower resolutions we can...
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_smoothmove.cpp
index 450cd53..85587cd 100644 (file)
@@ -50,6 +50,8 @@
 #include "onemoment.h"
 #include <synfigapp/main.h>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -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());