Commit 5b3a04e8 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fixed rotation tablet sensor on Windows

Wintab returns bogus resolution for rotation so just use
standard values instead

BUG:331358
parent 84e6f2a7
......@@ -43,8 +43,10 @@ struct QTabletDeviceData
int minTanPressure;
int maxTanPressure;
int minX, maxX, minY, maxY, minZ, maxZ;
#ifdef Q_WS_X11 // on windows the scale is fixed (and hardcoded)
int minRotation;
int maxRotation;
#endif /* Q_WS_X11 */
inline QPointF scaleCoord(int coordX, int coordY, int outOriginX, int outExtentX,
int outOriginY, int outExtentY) const;
#endif
......
......@@ -232,9 +232,6 @@ static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab)
qt_tablet_tilt_support = tpOri[0].axResolution && tpOri[1].axResolution;
}
tdd.minRotation = 0;
tdd.maxRotation = int(tpOri[2].axResolution);
tdd.minX = int(lc.lcOutOrgX);
tdd.maxX = int(qAbs(lc.lcOutExtX)) + int(lc.lcOutOrgX);
......@@ -249,7 +246,6 @@ static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab)
qDebug() << ppVar(tdd.minPressure) << ppVar(tdd.maxPressure);
qDebug() << ppVar(tdd.minTanPressure) << ppVar(tdd.maxTanPressure);
qDebug() << ppVar(qt_tablet_tilt_support);
qDebug() << ppVar(tdd.minRotation) << ppVar(tdd.maxRotation);
qDebug() << ppVar(tdd.minX) << ppVar(tdd.maxX);
qDebug() << ppVar(tdd.minY) << ppVar(tdd.maxY);
qDebug() << ppVar(tdd.minZ) << ppVar(tdd.maxZ);
......@@ -477,9 +473,9 @@ bool translateTabletEvent(const MSG &msg, PACKET *localPacketBuf,
tiltX = int(degX * (180 / Q_PI));
tiltY = int(-degY * (180 / Q_PI));
// FIXME: rotation support is not finished yet!
rotation = qreal(ort.orTwist - currentTabletPointer.minRotation) /
(currentTabletPointer.maxRotation - currentTabletPointer.minRotation) * 360.0;
// Rotation is measured in degrees. Axis inverted to fit
// the coordinate system of the Linux driver.
rotation = (360 - 1) - ort.orTwist / 10;
}
if (KisTabletDebugger::instance()->debugRawTabletValues()) {
......
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