summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2018-03-06 18:05:02 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2018-03-09 10:45:26 +0000
commit9b7809a43ee0add8c11d3387b73a01bfdedd0043 (patch)
tree9d81e1d7d7d242b1e241c748b48f5faebd4b3a56
parent4d204854745f6682d9937b8c13a429890e5bc738 (diff)
xcb: Fix FP1616 to int conversion
Divide the whole FP1616 value by 0x10000 instead of dividing the integer part by 0x10000 and the fractional part by 0xFFFF. It also makes fixed1616ToInt() consistent with fixed1616ToReal(), see 7d3f353a5bd573dc0e72f7f55c70212a6b3837fa. Change-Id: Id76025028c926872b002ef0a1ca8a8bdc2de3e1e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index e9a6e536a7..fed096f311 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2333,7 +2333,7 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
#if QT_CONFIG(xinput2)
static inline int fixed1616ToInt(FP1616 val)
{
- return int((qreal(val >> 16)) + (val & 0xFFFF) / (qreal)0xFFFF);
+ return int(qreal(val) / 0x10000);
}
void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource source)