Index: components/html_viewer/touch_handler.cc |
diff --git a/components/html_viewer/touch_handler.cc b/components/html_viewer/touch_handler.cc |
index 4764867eb15e7dc7be50c8f2100b61d494d0311d..44a2f94ccd0ec5af3caaebe033dd81ae5bc744cf 100644 |
--- a/components/html_viewer/touch_handler.cc |
+++ b/components/html_viewer/touch_handler.cc |
@@ -15,6 +15,7 @@ |
namespace html_viewer { |
namespace { |
+// TODO(rjkroege): Understand why we need this code in html_viewer. |
sadrul
2015/09/09 04:19:04
GR currently happens in html_viewer. So it needs t
rjkroege
2015/09/09 19:45:38
thanks. TODO updated.
|
void SetPropertiesFromEvent(const mojo::Event& event, |
ui::PointerProperties* properties) { |
properties->id = event.pointer_data->pointer_id; |
@@ -22,10 +23,20 @@ void SetPropertiesFromEvent(const mojo::Event& event, |
properties->y = event.pointer_data->y; |
properties->raw_x = event.pointer_data->screen_x; |
properties->raw_y = event.pointer_data->screen_y; |
- properties->pressure = event.pointer_data->pressure; |
- properties->SetAxesAndOrientation(event.pointer_data->radius_major, |
- event.pointer_data->radius_minor, |
- event.pointer_data->orientation); |
+ |
+ if (event.pointer_data->kind == mojo::POINTER_KIND_TOUCH || |
+ event.pointer_data->kind == mojo::POINTER_KIND_PEN) { |
+ properties->pressure = event.pointer_data->brush_data->pressure; |
+ |
+ // TODO(rjkroege): vary orientation for width, height. |
+ properties->SetAxesAndOrientation(event.pointer_data->brush_data->width, |
+ event.pointer_data->brush_data->height, |
+ 0.0); |
+ } else { |
+ // TODO(rjkroege): This might need to .5 when the button is down to |
+ // satisfy the Pointer events specification. |
+ properties->pressure = 0.0; |
+ } |
// TODO(sky): Add support for tool_type. |
} |