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

Unified Diff: ui/touch_selection/touch_handle.cc

Issue 1294933006: Don't use the touch rect when targetting above the touch handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/touch_selection/touch_handle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_handle.cc
diff --git a/ui/touch_selection/touch_handle.cc b/ui/touch_selection/touch_handle.cc
index e2faff1f382cf4b85ea2892dbb1f4e7965ed03ad..ef87d992642c27048594f23c1a240f3b2d9d2664 100644
--- a/ui/touch_selection/touch_handle.cc
+++ b/ui/touch_selection/touch_handle.cc
@@ -160,9 +160,12 @@ bool TouchHandle::WillHandleTouchEvent(const MotionEvent& event) {
const float touch_radius = std::max(
kMinTouchMajorForHitTesting,
std::min(kMaxTouchMajorForHitTesting, event.GetTouchMajor())) * 0.5f;
- if (!RectIntersectsCircle(drawable_->GetVisibleBounds(),
- touch_point,
- touch_radius)) {
+ const gfx::RectF drawable_bounds = drawable_->GetVisibleBounds();
+ // Only use the touch radius for targetting if the touch is at or below
+ // the drawable area. This makes it easier to interact with the line of
+ // text above the drawable.
+ if (touch_point.y() < drawable_bounds.y() ||
+ !RectIntersectsCircle(drawable_bounds, touch_point, touch_radius)) {
EndDrag();
return false;
}
« no previous file with comments | « no previous file | ui/touch_selection/touch_handle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698