X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgtkmm%2Fstate_smoothmove.cpp;h=f42df35eb9437e295ea80ba5ad54ff2876ab656e;hb=c11c4966980ed301f40b3dcc24e4fbec525f93e3;hp=6f96f572054aa6f6d1820627df3c9ef9bfb993b7;hpb=1b0547169603e911e37bf1f3d56ceb023b87cc91;p=synfig.git diff --git a/synfig-studio/src/gtkmm/state_smoothmove.cpp b/synfig-studio/src/gtkmm/state_smoothmove.cpp index 6f96f57..f42df35 100644 --- a/synfig-studio/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/src/gtkmm/state_smoothmove.cpp @@ -40,6 +40,7 @@ #include #include "state_smoothmove.h" +#include "state_normal.h" #include "canvasview.h" #include "workarea.h" #include "app.h" @@ -98,6 +99,7 @@ public: class studio::StateSmoothMove_Context : public sigc::trackable { etl::handle canvas_view_; + CanvasView::IsWorking is_working; //Duckmatic::Push duckmatic_push; @@ -143,6 +145,7 @@ StateSmoothMove::StateSmoothMove(): Smach::state("smooth_move") { insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateSmoothMove_Context::event_refresh_tool_options)); + insert(event_def(EVENT_STOP,&StateSmoothMove_Context::event_stop_handler)); } StateSmoothMove::~StateSmoothMove() @@ -168,6 +171,7 @@ StateSmoothMove_Context::save_settings() StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): canvas_view_(canvas_view), + is_working(*canvas_view), // duckmatic_push(get_work_area()), settings(synfigapp::Main::get_selected_input_device()->settings()), duck_dragger_(new DuckDrag_SmoothMove()), @@ -193,8 +197,8 @@ StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): App::toolbox->refresh(); -// get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->set_cursor(Gdk::FLEUR); + //get_work_area()->reset_cursor(); load_settings(); } @@ -215,12 +219,19 @@ StateSmoothMove_Context::event_refresh_tool_options(const Smach::event& /*x*/) return Smach::RESULT_ACCEPT; } +Smach::event_result +StateSmoothMove_Context::event_stop_handler(const Smach::event& /*x*/) +{ + throw &state_normal; + return Smach::RESULT_OK; +} + StateSmoothMove_Context::~StateSmoothMove_Context() { save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); @@ -302,29 +313,7 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vecto } // then patch up the tangents for the vertices we've moved - DuckList duck_list(duckmatic->get_duck_list()); - for (iter=selected_ducks.begin(); iter!=selected_ducks.end(); ++iter) - { - etl::handle duck(*iter); - if (duck->get_type() == Duck::TYPE_VERTEX || duck->get_type() == Duck::TYPE_POSITION) - { - ValueNode_Composite::Handle composite; - - if ((ValueNode_BLineCalcVertex::Handle::cast_dynamic(duck->get_value_desc().get_value_node())) || - ((composite = ValueNode_Composite::Handle::cast_dynamic(duck->get_value_desc().get_value_node())) && - composite->get_type() == ValueBase::TYPE_BLINEPOINT && - (ValueNode_BLineCalcVertex::Handle::cast_dynamic(composite->get_link("point"))))) - { - //! \todo update() will call dynamic cast again, see if we can avoid that - DuckList::iterator iter; - for (iter=duck_list.begin(); iter!=duck_list.end(); iter++) - if ((*iter)->get_origin_duck()==duck - && std::find(selected_ducks.begin(), - selected_ducks.end(), *iter) == selected_ducks.end() ) - (*iter)->update(time); - } - } - } + duckmatic->update_ducks(); last_translate_=vect; //snap=Vector(0,0);