From 91478edd9fd44ed15741feeed32af1d2d53b978d Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Wed, 23 Nov 2016 20:16:28 +0100 Subject: [PATCH] fix(menu): improves menu swipe animation --- src/animations/animation.ts | 2 +- src/components/menu/menu-types.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/animations/animation.ts b/src/animations/animation.ts index 5d2ff897049..68ada6a9cd0 100644 --- a/src/animations/animation.ts +++ b/src/animations/animation.ts @@ -1016,7 +1016,7 @@ export class Animation { if (dur < 0) { dur = this._dur; } - this._isAsync = (currentStepValue > 0.05 && currentStepValue < 0.95 && dur > 30); + this._isAsync = (dur > 30); this._progressEnd(shouldComplete, stepValue, dur, this._isAsync); diff --git a/src/components/menu/menu-types.ts b/src/components/menu/menu-types.ts index 4c4714376d3..8ecc4e93d60 100644 --- a/src/components/menu/menu-types.ts +++ b/src/components/menu/menu-types.ts @@ -59,7 +59,8 @@ export class MenuType { done(isOpen); }, true); - let dur = this.ani.getDuration() / (Math.abs(velocity) + 1); + let factor = 1 - Math.min(Math.abs(velocity) / 4, 0.7); + let dur = this.ani.getDuration() * factor; this.ani.progressEnd(shouldComplete, currentStepValue, dur); }