summaryrefslogtreecommitdiffstats
path: root/views/touchui
diff options
context:
space:
mode:
authorvarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 03:16:57 +0000
committervarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 03:16:57 +0000
commit09ba32619bab580cf09824850a3c86b10689894c (patch)
tree7854f04ce969972f988c26a444c927ec2f09d395 /views/touchui
parentf2016a6a751ba088c620132f680fb381f14a336b (diff)
downloadchromium_src-09ba32619bab580cf09824850a3c86b10689894c.zip
chromium_src-09ba32619bab580cf09824850a3c86b10689894c.tar.gz
chromium_src-09ba32619bab580cf09824850a3c86b10689894c.tar.bz2
Minor fix to touch selection logic.
BUG=none TEST=none Review URL: http://codereview.chromium.org/7696013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/touchui')
-rw-r--r--views/touchui/touch_selection_controller_impl.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/views/touchui/touch_selection_controller_impl.cc b/views/touchui/touch_selection_controller_impl.cc
index 273f30b..10bf572 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) {