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

Side by Side Diff: ui/base/gestures/gesture_point.cc

Issue 10831043: gesture recognizer: Fix computing the bounding box of the rectangles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/base/gestures/gesture_sequence.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/gestures/gesture_point.h" 5 #include "ui/base/gestures/gesture_point.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/base/events.h" 10 #include "ui/base/events.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // use this to compute a more representative rectangular touch region. 180 // use this to compute a more representative rectangular touch region.
181 if (event.RadiusX() || event.RadiusY()) 181 if (event.RadiusX() || event.RadiusY())
182 radius = std::max(event.RadiusX(), event.RadiusY()); 182 radius = std::max(event.RadiusX(), event.RadiusY());
183 else 183 else
184 radius = GestureConfiguration::default_radius(); 184 radius = GestureConfiguration::default_radius();
185 185
186 gfx::Rect rect(event.GetLocation().x() - radius, 186 gfx::Rect rect(event.GetLocation().x() - radius,
187 event.GetLocation().y() - radius, 187 event.GetLocation().y() - radius,
188 radius * 2, 188 radius * 2,
189 radius * 2); 189 radius * 2);
190 enclosing_rect_ = enclosing_rect_.Union(rect); 190 if (IsInClickWindow(event))
191 enclosing_rect_ = enclosing_rect_.Union(rect);
192 else
193 enclosing_rect_ = rect;
191 } 194 }
192 195
193 } // namespace ui 196 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/base/gestures/gesture_sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698