Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 199277bc authored by Adriaan de Groot's avatar Adriaan de Groot 💬

Although math.h may #define NAN, that's a c99-ism; use the C++ approach instead to get at a NaN.

svn path=/trunk/koffice/; revision=811912
parent 7fda78fd
......@@ -57,6 +57,8 @@
#include <kdebug.h>
#include <limits>
class KoShape::Private {
public:
Private(KoShape *shape)
......@@ -484,10 +486,10 @@ double KoShape::rotation() const {
// check if the matrix has shearing mixed in
if( fabs( fabs(d->localMatrix.m12()) - fabs(d->localMatrix.m21()) ) > 1e-10 )
return NAN;
return std::numeric_limits<double>::quiet_NaN();
// check if the matrix has scaling mixed in
if( fabs( d->localMatrix.m11() - d->localMatrix.m22() ) > 1e-10 )
return NAN;
return std::numeric_limits<double>::quiet_NaN();
// calculate the angle from the matrix elements
double angle = atan2( -d->localMatrix.m21(), d->localMatrix.m11() ) * 180.0 / M_PI;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment