Chromium Code Reviews| Index: third_party/WebKit/Source/core/events/PointerEventManager.cpp |
| diff --git a/third_party/WebKit/Source/core/events/PointerEventManager.cpp b/third_party/WebKit/Source/core/events/PointerEventManager.cpp |
| index bca636912200e463fb450b42f244c4c4be7edcd3..f301ac32de1a5259b5eee60ba0bcb1f03f8becf9 100644 |
| --- a/third_party/WebKit/Source/core/events/PointerEventManager.cpp |
| +++ b/third_party/WebKit/Source/core/events/PointerEventManager.cpp |
| @@ -65,6 +65,9 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventManager::create(const AtomicStr |
| pointerEventInit.setButton(mouseEvent.button()); |
| pointerEventInit.setButtons(MouseEvent::platformModifiersToButtons(mouseEvent.modifiers())); |
| + pointerEventInit.setPressure(isnan(mouseEvent.pointerProperties().force) |
| + ? (pointerEventInit.buttons() ? 0.5 : 0) |
| + : mouseEvent.pointerProperties().force); |
| UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.modifiers()); |
| @@ -98,7 +101,6 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventManager::create(const AtomicStr |
| pointerEventInit.setWidth(width); |
| pointerEventInit.setHeight(height); |
| - pointerEventInit.setPressure(touchPoint.force()); |
| pointerEventInit.setTiltX(touchPoint.pointerProperties().tiltX); |
| pointerEventInit.setTiltY(touchPoint.pointerProperties().tiltY); |
| pointerEventInit.setScreenX(touchPoint.screenPos().x()); |
| @@ -107,6 +109,9 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventManager::create(const AtomicStr |
| pointerEventInit.setClientY(clientY); |
| pointerEventInit.setButton(0); |
| pointerEventInit.setButtons(pointerReleasedOrCancelled ? 0 : 1); |
| + pointerEventInit.setPressure(isnan(touchPoint.force()) |
|
mustaq
2016/01/25 16:34:29
Please create a helper function to avoid repeats.
Navid Zolghadr
2016/01/25 20:26:50
Done.
|
| + ? (pointerEventInit.buttons() ? 0.5 : 0) |
| + : touchPoint.force()); |
| UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, modifiers); |