Fix 1959064: Crash when use circle tool over an existing duck.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 23 Sep 2008 12:19:26 +0000 (12:19 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 23 Sep 2008 12:19:26 +0000 (12:19 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2066 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/state_circle.cpp
synfig-studio/trunk/src/gtkmm/state_gradient.cpp
synfig-studio/trunk/src/gtkmm/state_rectangle.cpp
synfig-studio/trunk/src/gtkmm/state_star.cpp

index f23632c..09667ad 100644 (file)
@@ -934,6 +934,7 @@ StateCircle_Context::event_mouse_click_handler(const Smach::event& x)
 
        if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_DRAG && event.button==BUTTON_LEFT)
        {
+               if (!point2_duck) return Smach::RESULT_OK;
                point2_duck->set_point(point_holder-get_work_area()->snap_point_to_grid(event.pos));
                get_work_area()->queue_draw();
                return Smach::RESULT_ACCEPT;
index e92a92b..688b7e6 100644 (file)
@@ -493,6 +493,7 @@ StateGradient_Context::event_mouse_click_handler(const Smach::event& x)
 
        if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_DRAG && event.button==BUTTON_LEFT)
        {
+               if (!point2_duck) return Smach::RESULT_OK;
                point2_duck->set_point(get_work_area()->snap_point_to_grid(event.pos));
                get_work_area()->queue_draw();
                return Smach::RESULT_ACCEPT;
index c1fcc59..8959429 100644 (file)
@@ -829,6 +829,7 @@ StateRectangle_Context::event_mouse_click_handler(const Smach::event& x)
 
        if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_DRAG && event.button==BUTTON_LEFT)
        {
+               if (!point2_duck) return Smach::RESULT_OK;
                point2_duck->set_point(get_work_area()->snap_point_to_grid(event.pos));
                get_work_area()->queue_draw();
                return Smach::RESULT_ACCEPT;
index 5fe9440..df75ec9 100644 (file)
@@ -960,6 +960,7 @@ StateStar_Context::event_mouse_click_handler(const Smach::event& x)
 
        if(event.key==EVENT_WORKAREA_MOUSE_BUTTON_DRAG && event.button==BUTTON_LEFT)
        {
+               if (!point2_duck) return Smach::RESULT_OK;
                point2_duck->set_point(point_holder-get_work_area()->snap_point_to_grid(event.pos));
                get_work_area()->queue_draw();
                return Smach::RESULT_ACCEPT;