xcb: Fix FP1616 to double conversion
We should divide the fractional part of the FP1616 value by 0x10000 instead of 0xFFFF, otherwise 1.FFFF will be converted to 2.0. And right-shifting the integer part by 16 is equal to dividing it by 0x10000. So just divide the whole FP1616 value by 0x10000. Change-Id: Ia89a274b81be9cf502e1f311f696a610a7f37d7f Task-number: QTBUG-45378 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
7d1ec1ae9e
commit
7d3f353a5b
@ -450,7 +450,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 & 0xFFFF) / (qreal)0xFFFF;
|
||||
return qreal(val) / 0x10000;
|
||||
}
|
||||
#endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user