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 7d3f353a5b.

Change-Id: Id76025028c926872b002ef0a1ca8a8bdc2de3e1e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Alexander Volkov 2018-03-06 18:05:02 +03:00
parent 4d20485474
commit 9b7809a43e

View File

@ -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)