X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_circle.cpp;h=244862db0bcdfcde367e202ac21cfdc96e9caf8a;hb=41063fc828642a7ae12aeb50694f1cd4580eb467;hp=3bad7bf63e8b79229bc762b55faee434b6008fd2;hpb=7c7a0076ee45cffd2165eefe4ede81e4a631ac18;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index 3bad7bf..244862d 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -6,6 +6,7 @@ ** ** \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 @@ -474,6 +475,7 @@ StateCircle_Context::event_mouse_click_handler(const Smach::event& x) point2_duck->set_radius(true); point2_duck->set_scalar(-1); point2_duck->set_type(Duck::TYPE_RADIUS); + point2_duck->set_hover(true); get_work_area()->add_duck(point2_duck); return Smach::RESULT_ACCEPT; @@ -488,7 +490,15 @@ StateCircle_Context::event_mouse_click_handler(const Smach::event& x) if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_UP && event.button==BUTTON_LEFT) { - make_circle(point_holder, get_work_area()->snap_point_to_grid(event.pos)); + Point point(get_work_area()->snap_point_to_grid(event.pos)); + + if (App::restrict_radius_ducks) + { + if ((point[0] - point_holder[0]) < 0) point[0] = point_holder[0]; + if ((point[1] - point_holder[1]) < 0) point[1] = point_holder[1]; + } + + make_circle(point_holder, point); get_work_area()->clear_ducks(); return Smach::RESULT_ACCEPT; }