diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/touchui/touch_selection_controller_impl.cc | 9 | ||||
-rw-r--r-- | views/touchui/touch_selection_controller_impl.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/views/touchui/touch_selection_controller_impl.cc b/views/touchui/touch_selection_controller_impl.cc index 0e965d2..2a28014 100644 --- a/views/touchui/touch_selection_controller_impl.cc +++ b/views/touchui/touch_selection_controller_impl.cc @@ -95,7 +95,7 @@ class TouchSelectionControllerImpl::SelectionHandleView : public View { } virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE { - controller_->SelectionHandleDragged(event.x()); + controller_->SelectionHandleDragged(event.location()); return true; } @@ -202,7 +202,8 @@ void TouchSelectionControllerImpl::ClientViewLostFocus() { selection_handle_2_->SetVisible(false); } -void TouchSelectionControllerImpl::SelectionHandleDragged(int x) { +void TouchSelectionControllerImpl::SelectionHandleDragged( + const gfx::Point& drag_pos) { if (client_view_->GetWidget()) { DCHECK(dragging_handle_); // Find the stationary selection handle. @@ -211,10 +212,10 @@ void TouchSelectionControllerImpl::SelectionHandleDragged(int x) { fixed_handle = selection_handle_2_.get(); // Find selection end points in client_view's coordinate system. - gfx::Point p1(x + kSelectionHandleRadius, -1); + gfx::Point p1(drag_pos.x() + kSelectionHandleRadius, drag_pos.y()); ConvertPointToClientView(dragging_handle_, &p1); - gfx::Point p2(kSelectionHandleRadius, -1); + gfx::Point p2(kSelectionHandleRadius, 0); ConvertPointToClientView(fixed_handle, &p2); // Instruct client_view to select the region between p1 and p2. The position diff --git a/views/touchui/touch_selection_controller_impl.h b/views/touchui/touch_selection_controller_impl.h index f5d83f4..6ae33e3 100644 --- a/views/touchui/touch_selection_controller_impl.h +++ b/views/touchui/touch_selection_controller_impl.h @@ -32,7 +32,7 @@ class TouchSelectionControllerImpl : public TouchSelectionController { // Callback to inform the client view that the selection handle has been // dragged, hence selection may need to be updated. - void SelectionHandleDragged(int x); + void SelectionHandleDragged(const gfx::Point& drag_pos); // Convenience method to convert a point from a selection handle's coordinate // system to that of the client view. |