Commit f3d5009d authored by rbyers@chromium.org's avatar rbyers@chromium.org

Enable floating point touch co-ordinates in EventSender

WebTouchPoint has used floating point co-ordinate and radius values for awhile, but we've never allowed generating non-integer values via EventSender.

BUG=323935

Review URL: https://codereview.chromium.org/316303002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275340 0039d316-1c4b-4281-b951-d872f2087c98
parent 91b358ba
...@@ -633,7 +633,7 @@ void EventSenderBindings::ReleaseTouchPoint(unsigned index) { ...@@ -633,7 +633,7 @@ void EventSenderBindings::ReleaseTouchPoint(unsigned index) {
void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) { void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) {
if (sender_) if (sender_)
sender_->UpdateTouchPoint(index, static_cast<int>(x), static_cast<int>(y)); sender_->UpdateTouchPoint(index, static_cast<float>(x), static_cast<float>(y));
} }
void EventSenderBindings::CancelTouchPoint(unsigned index) { void EventSenderBindings::CancelTouchPoint(unsigned index) {
...@@ -1457,7 +1457,7 @@ void EventSender::ReleaseTouchPoint(unsigned index) { ...@@ -1457,7 +1457,7 @@ void EventSender::ReleaseTouchPoint(unsigned index) {
touch_point->state = WebTouchPoint::StateReleased; touch_point->state = WebTouchPoint::StateReleased;
} }
void EventSender::UpdateTouchPoint(unsigned index, int x, int y) { void EventSender::UpdateTouchPoint(unsigned index, float x, float y) {
if (index >= touch_points_.size()) { if (index >= touch_points_.size()) {
ThrowTouchPointError(); ThrowTouchPointError();
return; return;
...@@ -1615,8 +1615,8 @@ void EventSender::AddTouchPoint(gin::Arguments* args) { ...@@ -1615,8 +1615,8 @@ void EventSender::AddTouchPoint(gin::Arguments* args) {
WebTouchPoint touch_point; WebTouchPoint touch_point;
touch_point.state = WebTouchPoint::StatePressed; touch_point.state = WebTouchPoint::StatePressed;
touch_point.position = WebFloatPoint(static_cast<int>(x), touch_point.position = WebFloatPoint(static_cast<float>(x),
static_cast<int>(y)); static_cast<float>(y));
touch_point.screenPosition = touch_point.position; touch_point.screenPosition = touch_point.position;
if (!args->PeekNext().IsEmpty()) { if (!args->PeekNext().IsEmpty()) {
...@@ -1634,8 +1634,8 @@ void EventSender::AddTouchPoint(gin::Arguments* args) { ...@@ -1634,8 +1634,8 @@ void EventSender::AddTouchPoint(gin::Arguments* args) {
} }
} }
touch_point.radiusX = static_cast<int>(radius_x); touch_point.radiusX = static_cast<float>(radius_x);
touch_point.radiusY = static_cast<int>(radius_y); touch_point.radiusY = static_cast<float>(radius_y);
} }
int lowest_id = 0; int lowest_id = 0;
......
...@@ -103,7 +103,7 @@ class EventSender : public base::SupportsWeakPtr<EventSender> { ...@@ -103,7 +103,7 @@ class EventSender : public base::SupportsWeakPtr<EventSender> {
void ClearTouchPoints(); void ClearTouchPoints();
void ReleaseTouchPoint(unsigned index); void ReleaseTouchPoint(unsigned index);
void UpdateTouchPoint(unsigned index, int x, int y); void UpdateTouchPoint(unsigned index, float x, float y);
void CancelTouchPoint(unsigned index); void CancelTouchPoint(unsigned index);
void SetTouchModifier(const std::string& key_name, bool set_mask); void SetTouchModifier(const std::string& key_name, bool set_mask);
void SetTouchCancelable(bool cancelable); void SetTouchCancelable(bool cancelable);
......
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