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

Unified Diff: views/touchui/touch_selection_controller_impl.cc

Issue 7696013: Minor fix to touch selection logic. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: modified according to comments Created 9 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 | « views/controls/textfield/native_textfield_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/touchui/touch_selection_controller_impl.cc
diff --git a/views/touchui/touch_selection_controller_impl.cc b/views/touchui/touch_selection_controller_impl.cc
index 273f30bd96ac0dd2820734fadfc0b647076ed76b..10bf572820a0f7849de07cf8cce17b290d2123c6 100644
--- a/views/touchui/touch_selection_controller_impl.cc
+++ b/views/touchui/touch_selection_controller_impl.cc
@@ -161,18 +161,10 @@ void TouchSelectionControllerImpl::SelectionChanged(const gfx::Point& p1,
if (dragging_handle_) {
// We need to reposition only the selection handle that is being dragged.
- // The other handle stays the same.
- SelectionHandleView* fixed_handle = selection_handle_1_.get();
- if (fixed_handle == dragging_handle_)
- fixed_handle = selection_handle_2_.get();
-
- gfx::Point fixed_handle_pos = fixed_handle->GetScreenPosition();
- fixed_handle_pos.Offset(kSelectionHandleRadius, 0);
-
- if (fixed_handle_pos == screen_pos_1)
- dragging_handle_->SetScreenPosition(screen_pos_2);
- else
- dragging_handle_->SetScreenPosition(screen_pos_1);
+ // The other handle stays the same. Also, the selection handle being dragged
+ // will always be at the end of selection, while the other handle will be at
+ // the start.
+ dragging_handle_->SetScreenPosition(screen_pos_2);
} else {
// Check if there is any selection at all.
if (screen_pos_1 == screen_pos_2) {
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698