Commit ac6d1582 authored by Yeol's avatar Yeol Committed by Commit Bot

Modified PointerEvent.width/height to double of TouchPoint.radius_x/y.

TouchPoint radius of the ellipse should exactly equal to half
the corresponding extent of the rectangle.
assuming non-rotated touch geometry.

Bug: 731725
Change-Id: Ibf19c867549f13676afbc6cd0d504850fb415159
Reviewed-on: https://chromium-review.googlesource.com/762827Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarNavid Zolghadr <nzolghadr@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522448}
parent 306c4cdc
......@@ -39,9 +39,9 @@ async_test(function() {
for (var i = 0 ; i < POINTER_PROPERTIES.length; ++i) {
var pp = POINTER_PROPERTIES[i];
if (i != POINTER_PROPERTIES.length-1)
eventSender.addTouchPoint(x + i, y + i, pp["width"], pp["height"], pp["pressure"], pp["tiltX"], pp["tiltY"], pp["pointerType"]);
eventSender.addTouchPoint(x + i, y + i, pp["width"] / 2.0, pp["height"] / 2.0, pp["pressure"], pp["tiltX"], pp["tiltY"], pp["pointerType"]);
else // Test default pointerType
eventSender.addTouchPoint(x + i, y + i, pp["width"], pp["height"], pp["pressure"], pp["tiltX"], pp["tiltY"]);
eventSender.addTouchPoint(x + i, y + i, pp["width"] / 2.0, pp["height"] / 2.0, pp["pressure"], pp["tiltX"], pp["tiltY"]);
}
eventSender.touchStart();
......
......@@ -89,9 +89,8 @@ WebTouchPoint CreateWebTouchPointFromWebPointerEvent(
WebTouchPoint web_touch_point(web_pointer_event);
web_touch_point.state =
TouchPointStateFromPointerEventType(web_pointer_event.GetType(), stale);
// TODO(crbug.com/731725): This mapping needs a division by 2.
web_touch_point.radius_x = web_pointer_event.width;
web_touch_point.radius_y = web_pointer_event.height;
web_touch_point.radius_x = web_pointer_event.width / 2.f;
web_touch_point.radius_y = web_pointer_event.height / 2.f;
web_touch_point.rotation_angle = web_pointer_event.rotation_angle;
return web_touch_point;
}
......@@ -197,7 +196,7 @@ Touch* TouchEventManager::CreateDomTouch(
->RootFrameToDocument(transformed_event.PositionInWidget())
.ScaledBy(scale_factor);
FloatSize adjusted_radius =
FloatSize(transformed_event.width, transformed_event.height)
FloatSize(transformed_event.width / 2.f, transformed_event.height / 2.f)
.ScaledBy(scale_factor);
return Touch::Create(target_frame, touch_node, point_attr->event_.id,
......
......@@ -34,9 +34,8 @@ WebPointerEvent::WebPointerEvent(const WebTouchEvent& touch_event,
const WebTouchPoint& touch_point)
: WebInputEvent(sizeof(WebPointerEvent)),
WebPointerProperties(touch_point),
// TODO(crbug.com/731725): This mapping needs a times by 2.
width(touch_point.radius_x),
height(touch_point.radius_y) {
width(touch_point.radius_x * 2.f),
height(touch_point.radius_y * 2.f) {
// WebInutEvent attributes
SetFrameScale(touch_event.FrameScale());
SetFrameTranslate(touch_event.FrameTranslate());
......
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