tslib: fix detection of missing release coordinates
The release coordinates may be simply initialized to 0 in lower levels of the tslib. They are then passed through the calibration stage, which applies offset and multiplication to them, so they may end up even as positive numbers. Since we can't know if we can trust them or not simply ignore all release coordinates and just always use the ones from the previous event. Change-Id: Ib845b5ab1c5b81967cc089d601576893f433fa4a Reviewed-by: Martin Kepplinger <martink@posteo.de> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>bb10
parent
064a731a11
commit
e1167ed650
|
|
@ -114,8 +114,8 @@ void QTsLibMouseHandler::readMouseData()
|
|||
int x = sample.x;
|
||||
int y = sample.y;
|
||||
|
||||
// work around missing coordinates on mouse release
|
||||
if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) {
|
||||
// coordinates on release events can contain arbitrary values, just ignore them
|
||||
if (sample.pressure == 0) {
|
||||
x = m_x;
|
||||
y = m_y;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue