#include "widget_enum.h"
#include <synfigapp/main.h>
+#include "general.h"
+
#endif
/* === U S I N G =========================================================== */
if(id[id.size()-1]<='9' && id[id.size()-1]>='0')
{
// figure out how many digits it is
- for(digits=0;(int)id.size()-1>=digits && id[id.size()-1-digits]<='9' && id[id.size()-1-digits]>='0';digits++)while(false);
+ for (digits = 0;
+ (int)id.size()-1 >= digits && id[id.size()-1-digits] <= '9' && id[id.size()-1-digits] >= '0';
+ digits++)
+ ;
String str_number;
str_number=String(id,id.size()-digits,id.size());
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;
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;
}