Index: ash/wm/toplevel_window_event_handler.cc |
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc |
index a0d4b5e7e0b5b589c205c54c0c06f537e04466e9..a7df23984ac79f20f439742506e92e0cd3c6815e 100644 |
--- a/ash/wm/toplevel_window_event_handler.cc |
+++ b/ash/wm/toplevel_window_event_handler.cc |
@@ -301,17 +301,17 @@ void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
SetRestoreBoundsInParent(target, pre_drag_window_bounds_); |
wm::MaximizeWindow(target); |
} |
- } else if (wm::CanSnapWindow(target) && |
- fabs(event->details().velocity_x()) > |
- kMinHorizVelocityForWindowSwipe) { |
- // Snap left/right. |
- ui::ScopedLayerAnimationSettings scoped_setter( |
- target->layer()->GetAnimator()); |
- scoped_setter.SetPreemptionStrategy( |
- ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
- internal::SnapSizer::SnapWindow(target, |
- event->details().velocity_x() < 0 ? |
- internal::SnapSizer::LEFT_EDGE : internal::SnapSizer::RIGHT_EDGE); |
+ } else { |
varkha
2013/08/30 17:13:25
Did you leave out the x-velocity check intentional
pkotwicz
2013/08/30 21:10:57
Good catch!
|
+ using internal::SnapSizer; |
+ SnapSizer::Edge edge = event->details().swipe_left() ? |
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; |
+ if (SnapSizer::CanSnapWindow(target, edge)) { |
+ ui::ScopedLayerAnimationSettings scoped_setter( |
+ target->layer()->GetAnimator()); |
+ scoped_setter.SetPreemptionStrategy( |
+ ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
+ SnapSizer::SnapWindow(target, edge, SnapSizer::STEP_NO); |
+ } |
} |
break; |
} |