diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-04-28 09:59:06 +0200 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-05-06 00:40:10 +0200 |
| commit | 9ec72c1917ec46e5228fd4d08dcaa8b5ed86885b (patch) | |
| tree | efc24fad4d7c674253a2834e5b0bb129f95759d3 /src/qml/jsruntime/qv4mathobject.cpp | |
| parent | 152e12dc22cc0fd07cf90bcd35ae0e05b8b46fa0 (diff) | |
Make tst_qquickflickable check scaling of drag threshold
We continue to enforce the drag threshold in local (transformed)
coordinates: if Flickable should wait until the user drags 12 pixels,
but it's scaled to half-size, it will start dragging after only 6 pixels
of movement, for example. But if it's also rotated, then the required
distance becomes a projection of the actual drag vector onto the vector
along which the Flickable should move past the (scaled) drag threshold.
I.e. if we rotate the Flickable's parent by 45°, the required distance
should be 12 / 2 * √2 ≈ 8.5; 9 pixels will exceed the threshold, then.
tst_qquickflickable::clickAndDragWhenTransformed is modified to prove it
(at least when a 2D scale is applied). The test should be OK on hidpi
because qApp->styleHints()->startDragDistance() is already adjusted.
Change-Id: I035a462c75e7c5aba876a67c1b996bccab2c5364
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4mathobject.cpp')
0 files changed, 0 insertions, 0 deletions
