summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-07-04 16:16:06 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-07-04 14:23:50 +0000
commitdee43c0084f5c8a241a9b67661868a70167f2e72 (patch)
treef9f9e05e709b73d888c2e26696d9b29bf8e0ff92
parent06864c75f4d009bf8fd4e9f88215bb88341ed873 (diff)
downloadqtwebengine-dee43c0084f5c8a241a9b67661868a70167f2e72.tar.gz
Fix regression with fine-grained wheel events
The division needs to be done in float, otherwise steps smaller than one standard tick will be rounded to zero. Change-Id: Id939be062f1575104ca6cd66f05892841ec27569 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--src/core/web_event_factory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 80f81e954..521a8b78e 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -656,8 +656,8 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub
webEvent.modifiers = modifiersForEvent(ev);
webEvent.timeStampSeconds = currentTimeForEvent(ev);
- webEvent.wheelTicksX = ev->angleDelta().x() / QWheelEvent::DefaultDeltasPerStep;
- webEvent.wheelTicksY = ev->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep;
+ webEvent.wheelTicksX = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
+ webEvent.wheelTicksY = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
// We can't use the device specific QWheelEvent::pixelDelta(), so we calculate
// a pixel delta based on ticks and scroll per line.