Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: ui/base/gestures/gesture_recognizer_impl.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vector length and conversion to size Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/gestures/gesture_recognizer_impl.cc
diff --git a/ui/base/gestures/gesture_recognizer_impl.cc b/ui/base/gestures/gesture_recognizer_impl.cc
index 78adfab9c0e6a1b0649a75ecd68f7320a29f96a1..993ae5b747b11bffd871d63b54b0233d4f176ddf 100644
--- a/ui/base/gestures/gesture_recognizer_impl.cc
+++ b/ui/base/gestures/gesture_recognizer_impl.cc
@@ -132,8 +132,8 @@ GestureConsumer* GestureRecognizerImpl::GetTargetForLocation(
for (int j = 0; j < GestureSequence::kMaxGesturePoints; ++j) {
if (!points[j].in_use())
continue;
- gfx::Point delta =
- points[j].last_touch_position().Subtract(location);
+ gfx::Point delta = points[j].last_touch_position().Subtract(
+ location.DistanceFromOrigin());
int distance = delta.x() * delta.x() + delta.y() * delta.y();
if (!closest_point || distance < closest_distance_squared) {
closest_point = &points[j];
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_gtk.h ('k') | ui/gfx/blit.h » ('j') | ui/gfx/point.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698