Commit 40b52eb4 authored by Xaver Hugl's avatar Xaver Hugl Committed by David Edmundson
Browse files

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
parent e41c5af6
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment