Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Change precision of xTilt/yTilt from `int` to `qreal`

Dmitry Kazakov89dc521c7d34
diff --git a/libs/flake/KoPointerEvent.cpp b/libs/flake/KoPointerEvent.cpp
index 0033685ffc..a05aa02880 100644
--- a/libs/flake/KoPointerEvent.cpp
+++ b/libs/flake/KoPointerEvent.cpp
@@ -352,7 +352,7 @@ qreal KoPointerEvent::tangentialPressure() const
return visit(Visitor(), d->eventPtr);
}
-int KoPointerEvent::xTilt() const
+qreal KoPointerEvent::xTilt() const
{
struct Visitor {
int operator() (const QTabletEvent *event) {
@@ -367,7 +367,7 @@ int KoPointerEvent::xTilt() const
}
-int KoPointerEvent::yTilt() const
+qreal KoPointerEvent::yTilt() const
{
struct Visitor {
int operator() (const QTabletEvent *event) {
diff --git a/libs/flake/KoPointerEvent.h b/libs/flake/KoPointerEvent.h
index a1b735760b..3fd16eb38a 100644
--- a/libs/flake/KoPointerEvent.h
+++ b/libs/flake/KoPointerEvent.h
@@ -152,7 +152,7 @@ public:
* towards the tablet's physical right. The angle is in the range -60
* to +60 degrees. The default value is 0.
*/
- int xTilt() const;
+ qreal xTilt() const;
/**
* Return the y position in widget coordinates.
@@ -166,7 +166,7 @@ public:
* towards the tablet's physical right. The angle is in the range -60
* to +60 degrees. The default value is 0.
*/
- int yTilt() const;
+ qreal yTilt() const;
/**
* Returns the z position of the device. Typically this is represented