X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fduck.cpp;h=e88306e1ebe5d31d70ffe48a338867b15348786f;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=aa1a350318f70d83186a2b4b875ddbfc2dc862fe;hpb=88718743362fc20d89e4c52cbc694ae99cd41884;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/duck.cpp b/synfig-studio/trunk/src/gtkmm/duck.cpp index aa1a350..e88306e 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.cpp +++ b/synfig-studio/trunk/src/gtkmm/duck.cpp @@ -112,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); } } @@ -208,7 +208,9 @@ Duck::set_sub_trans_point(const synfig::Point &x) int old_halves = round_to_int(Angle::deg(rotations).get()/180); rotations += change; int new_halves = round_to_int(Angle::deg(rotations).get()/180); - if (old_halves != new_halves) + 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 @@ -220,3 +222,23 @@ Duck::get_sub_trans_origin()const { return origin_duck?origin_duck->get_sub_trans_point():origin; } + +#ifdef _DEBUG +synfig::String +Duck::type_name(Type id) +{ + String ret; + + if (id & TYPE_POSITION) { if (!ret.empty()) ret += ", "; ret += "position"; } + if (id & TYPE_TANGENT ) { if (!ret.empty()) ret += ", "; ret += "tangent" ; } + if (id & TYPE_RADIUS ) { if (!ret.empty()) ret += ", "; ret += "radius" ; } + if (id & TYPE_WIDTH ) { if (!ret.empty()) ret += ", "; ret += "width" ; } + if (id & TYPE_ANGLE ) { if (!ret.empty()) ret += ", "; ret += "angle" ; } + if (id & TYPE_VERTEX ) { if (!ret.empty()) ret += ", "; ret += "vertex" ; } + + if (ret.empty()) + ret = "none"; + + return ret; +} +#endif // _DEBUG