X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fduck.cpp;h=6b012a74445020b25b9ba50b73e5faeaa622db77;hb=383d977ef1a85b4b8085cdcf8390b0c22c24989b;hp=7c5ba663542bd0acde2ab2b86bba13343b32c417;hpb=756c0d29ac1742f231e6615f9a577e574e35a4af;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/duck.cpp b/synfig-studio/trunk/src/gtkmm/duck.cpp index 7c5ba66..6b012a7 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.cpp +++ b/synfig-studio/trunk/src/gtkmm/duck.cpp @@ -74,7 +74,8 @@ Duck::Duck(): editable(false), radius_(false), tangent_(false), - hover_(false) + hover_(false), + ignore_(false) { duck_count++; _DuckCounter::counter++; } Duck::Duck(const synfig::Point &point): @@ -86,7 +87,9 @@ Duck::Duck(const synfig::Point &point): guid_(0), editable(false), radius_(false), - tangent_(false) + tangent_(false), + hover_(false), + ignore_(false) { duck_count++; _DuckCounter::counter++;} Duck::Duck(const synfig::Point &point,const synfig::Point &origin): @@ -97,7 +100,9 @@ Duck::Duck(const synfig::Point &point,const synfig::Point &origin): guid_(0), editable(false), radius_(true), - tangent_(false) + tangent_(false), + hover_(false), + ignore_(false) { duck_count++; _DuckCounter::counter++;} Duck::~Duck() { duck_count--; _DuckCounter::counter--;} @@ -107,16 +112,16 @@ Duck::get_data_guid()const { if(value_desc_.is_value_node()) return value_desc_.get_value_node()->get_guid(); - return GUID::hasher(get_name()); + return synfig::GUID::hasher(get_name()); } void Duck::set_name(const synfig::String &x) { name=x; - if(guid_==GUID::zero()) + if(guid_==synfig::GUID::zero()) { - guid_=GUID::hasher(name); + guid_=synfig::GUID::hasher(name); } } @@ -200,11 +205,13 @@ Duck::set_sub_trans_point(const synfig::Point &x) Angle change = get_point().angle() - old_angle; while (change < Angle::deg(-180)) change += Angle::deg(360); while (change > Angle::deg(180)) change -= Angle::deg(360); - int old_quarters = round_to_int(Angle::deg(rotations).get()/90); + int old_halves = round_to_int(Angle::deg(rotations).get()/180); rotations += change; - int new_quarters = round_to_int(Angle::deg(rotations).get()/90); - if (old_quarters != new_quarters) - synfig::info("rotation: %.2f turns", new_quarters/4.0); + int new_halves = round_to_int(Angle::deg(rotations).get()/180); + if (old_halves != new_halves && + (new_halves > 1 || new_halves < -1 || + old_halves > 1 || old_halves < -1)) + synfig::info("rotation: %.2f turns", new_halves/2.0); } else set_point((x-get_sub_trans_origin())/get_scalar());