From e6e385d724df6e43dcf9846c947576d61feb29d1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 9 Feb 2008 16:02:03 +0000 Subject: [PATCH] Take the 'restrict radius ducks' setting into account in the circle tool. git-svn-id: http://svn.voria.com/code@1640 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/state_circle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index 3bad7bf..878118e 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -488,7 +488,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]) * get_work_area()->get_pw() < 0) point[0] = point_holder[0]; + if ((point[1] - point_holder[1]) * get_work_area()->get_ph() > 0) point[1] = point_holder[1]; + } + + make_circle(point_holder, point); get_work_area()->clear_ducks(); return Smach::RESULT_ACCEPT; } -- 2.7.4