Discard sub-pixel movements in gestures
On some touch devices the screen edges sometimes don't work because it detects a 0.5px movement up or down, and that cancels the swipe gesture. This patch discards sub-pixel movements for gestures to fix that. BUG: 423842 BUG: 421212
This commit is contained in:
parent
e41c5af676
commit
40b52eb4a4
1 changed files with 5 additions and 0 deletions
|
@ -153,6 +153,11 @@ int GestureRecognizer::startSwipeGesture(uint fingerCount, const QPointF &startP
|
|||
void GestureRecognizer::updateSwipeGesture(const QSizeF &delta)
|
||||
{
|
||||
m_swipeUpdates << delta;
|
||||
if (std::abs(delta.width()) < 1 && std::abs(delta.height()) < 1) {
|
||||
// some (touch) devices report sub-pixel movement on screen edges
|
||||
// this often cancels gestures -> ignore these movements
|
||||
return;
|
||||
}
|
||||
// determine the direction of the swipe
|
||||
if (delta.width() == delta.height()) {
|
||||
// special case of diagonal, this is not yet supported, thus cancel all gestures
|
||||
|
|
Loading…
Reference in a new issue