| Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| index e74232868b513f12cc312a879e5c8d85f7599b50..b8d6348284f4a89526639a29ca9ad7e402856340 100644
|
| --- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "core/events/PointerEventFactory.h"
|
|
|
| +#include "platform/geometry/FloatSize.h"
|
| +
|
| namespace blink {
|
|
|
| namespace {
|
| @@ -130,8 +132,8 @@ PointerEvent* PointerEventFactory::create(
|
|
|
| PointerEvent* PointerEventFactory::create(const AtomicString& type,
|
| const PlatformTouchPoint& touchPoint, PlatformEvent::Modifiers modifiers,
|
| - const double width, const double height,
|
| - const double clientX, const double clientY)
|
| + const FloatSize& pointRadius,
|
| + const FloatPoint& pagePoint)
|
| {
|
| const PlatformTouchPoint::TouchState pointState = touchPoint.state();
|
|
|
| @@ -149,14 +151,14 @@ PointerEvent* PointerEventFactory::create(const AtomicString& type,
|
| setIdTypeButtons(pointerEventInit, touchPoint.pointerProperties(),
|
| pointerReleasedOrCancelled ? 0 : 1);
|
|
|
| - pointerEventInit.setWidth(width);
|
| - pointerEventInit.setHeight(height);
|
| + pointerEventInit.setWidth(pointRadius.width());
|
| + pointerEventInit.setHeight(pointRadius.height());
|
| pointerEventInit.setTiltX(touchPoint.pointerProperties().tiltX);
|
| pointerEventInit.setTiltY(touchPoint.pointerProperties().tiltY);
|
| pointerEventInit.setScreenX(touchPoint.screenPos().x());
|
| pointerEventInit.setScreenY(touchPoint.screenPos().y());
|
| - pointerEventInit.setClientX(clientX);
|
| - pointerEventInit.setClientY(clientY);
|
| + pointerEventInit.setClientX(pagePoint.x());
|
| + pointerEventInit.setClientY(pagePoint.y());
|
| pointerEventInit.setButton(pointerPressedOrReleased ? LeftButton: NoButton);
|
| pointerEventInit.setPressure(getPointerEventPressure(
|
| touchPoint.force(), pointerEventInit.buttons()));
|
| @@ -354,4 +356,16 @@ bool PointerEventFactory::isActiveButtonsState(const int pointerId)
|
| && m_pointerIdMapping.get(pointerId).isActiveButtons;
|
| }
|
|
|
| +int PointerEventFactory::getPointerEventId(
|
| + const WebPointerProperties& properties)
|
| +{
|
| + if (properties.pointerType
|
| + == WebPointerProperties::PointerType::Mouse)
|
| + return PointerEventFactory::s_mouseId;
|
| + IncomingId id(properties.pointerType, properties.id);
|
| + if (m_pointerIncomingIdMapping.contains(id))
|
| + return m_pointerIncomingIdMapping.get(id);
|
| + return PointerEventFactory::s_invalidId;
|
| +}
|
| +
|
| } // namespace blink
|
|
|