From f721a85b1e2a5c84a1a1a4d3f5b1c7fad7de854b Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 1 Sep 2014 17:35:35 +0400 Subject: xcb: fix coordinates of touch points Fix conversion from FP1616 to qreal. Use 16-bit mask 0xFFFF instead of 8-bit mask 0xFF. Change-Id: I0ee39b2e298b7ff7d7a67981925374d6a18f1474 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 84d00d0e09..60a36a8da1 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -413,7 +413,7 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) #if defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT) static qreal fixed1616ToReal(FP1616 val) { - return (qreal(val >> 16)) + (val & 0xFF) / (qreal)0xFF; + return (qreal(val >> 16)) + (val & 0xFFFF) / (qreal)0xFFFF; } #endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT) -- cgit v1.2.3