From: dooglus Date: Mon, 12 Nov 2007 09:34:19 +0000 (+0000) Subject: Working on 1827966: "Angles are recalculated to 360 mod". Experimenting with angles... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=84a3dfe5cc1fafe126a639db7d233ac3a93883f1;p=synfig.git Working on 1827966: "Angles are recalculated to 360 mod". Experimenting with angles. Define ETL_WRAP_ANGLES in ETL/_angle.h to revert to previous behaviour. git-svn-id: http://svn.voria.com/code@1139 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/ETL/trunk/ETL/_angle.h b/ETL/trunk/ETL/_angle.h index 78e91ba..eb7710b 100644 --- a/ETL/trunk/ETL/_angle.h +++ b/ETL/trunk/ETL/_angle.h @@ -130,6 +130,7 @@ public: return ret.mod(); } +#ifdef ETL_WRAP_ANGLES /*! Returns true if the shortest angle from the left-hand to the right-hand side is counter-clockwise */ @@ -175,6 +176,47 @@ public: bool operator!=(const angle &rhs)const { return std::abs(dist(rhs).v)>ANGLE_EPSILON; } +#else // ETL_WRAP_ANGLES + /*! Returns true if the left-hand + side is less than the + right-hand side */ + bool + operator<(const angle &rhs)const + { return v < rhs.v; } + + /*! Returns true if the left-hand + side is greater than the + right-hand side */ + bool + operator>(const angle &rhs)const + { return v > rhs.v; } + + /*! Returns true if the left-hand + side is less or equal to the + right-hand side */ + bool + operator<=(const angle &rhs)const + { return v <= rhs.v; } + + /*! Returns true if the left-hand + side is greater than or equal + to the right-hand side */ + bool + operator>=(const angle &rhs)const + { return v >= rhs.v; } + + /*! Returns true if the angles + are the same, or close */ + bool + operator==(const angle &rhs)const + { return std::abs(v - rhs.v)ANGLE_EPSILON; } +#endif // ETL_WRAP_ANGLES //! Absolute Angle Function /*! This function will return the