Gui: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include <numbers>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QGestureEvent>
|
||||
#include <QWidget>
|
||||
@@ -86,8 +88,8 @@ SoGesturePinchEvent::SoGesturePinchEvent(QPinchGesture* qpinch, QWidget *widget)
|
||||
deltaZoom = qpinch->scaleFactor();
|
||||
totalZoom = qpinch->totalScaleFactor();
|
||||
|
||||
deltaAngle = -unbranchAngle((qpinch->rotationAngle()-qpinch->lastRotationAngle()) / 180.0 * M_PI);
|
||||
totalAngle = -qpinch->totalRotationAngle() / 180 * M_PI;
|
||||
deltaAngle = -unbranchAngle((qpinch->rotationAngle()-qpinch->lastRotationAngle()) / 180.0 * std::numbers::pi);
|
||||
totalAngle = -qpinch->totalRotationAngle() / 180 * std::numbers::pi;
|
||||
|
||||
state = SbGestureState(qpinch->state());
|
||||
|
||||
@@ -111,7 +113,9 @@ SbBool SoGesturePinchEvent::isSoGesturePinchEvent(const SoEvent *ev) const
|
||||
*/
|
||||
double SoGesturePinchEvent::unbranchAngle(double ang)
|
||||
{
|
||||
return ang - 2.0 * M_PI * floor((ang + M_PI) / (2.0 * M_PI));
|
||||
using std::numbers::pi;
|
||||
|
||||
return ang - 2.0 * pi * floor((ang + pi) / (2.0 * pi));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user