forked from firka/flutter
fix the hang when clicking the drawer in the stocks app
R=eseidel@chromium.org Review URL: https://codereview.chromium.org/980043005
This commit is contained in:
@@ -73,9 +73,11 @@ class DrawerAnimation {
|
||||
|
||||
void _animateToPosition(double targetPosition) {
|
||||
double distance = (targetPosition - _position).abs();
|
||||
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
|
||||
double duration = math.min(targetDuration, _kMaxSettleDurationMS);
|
||||
_animate(duration, _position, targetPosition, _kAnimationCurve);
|
||||
if (distance != 0) {
|
||||
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
|
||||
double duration = math.min(targetDuration, _kMaxSettleDurationMS);
|
||||
_animate(duration, _position, targetPosition, _kAnimationCurve);
|
||||
}
|
||||
}
|
||||
|
||||
void handleFlingStart(event) {
|
||||
|
||||
Reference in New Issue
Block a user