Index: ui/touch_selection/touch_selection_controller.cc |
diff --git a/ui/touch_selection/touch_selection_controller.cc b/ui/touch_selection/touch_selection_controller.cc |
index 90f7c6241580f66532ff678d360f070a8fa82bc3..3baf946ea9dbcea156e01cec355b7d81a48d0b1b 100644 |
--- a/ui/touch_selection/touch_selection_controller.cc |
+++ b/ui/touch_selection/touch_selection_controller.cc |
@@ -89,6 +89,16 @@ void TouchSelectionController::OnSelectionBoundsChanged( |
client_->OnSelectionEvent(SELECTION_DISSOLVED); |
} |
+ // Swap the Handles when the start and end selection points cross each other. |
+ if (active_status_ == SELECTION_ACTIVE) { |
+ if ((start_selection_handle_->IsActive() && |
+ end_.edge_bottom() == start.edge_bottom()) || |
+ (end_selection_handle_->IsActive() && |
+ end.edge_bottom() == start_.edge_bottom())) { |
+ start_selection_handle_.swap(end_selection_handle_); |
+ } |
+ } |
+ |
start_ = start; |
end_ = end; |
start_orientation_ = ToTouchHandleOrientation(start_.type()); |