OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 FloatPoint ScrollAnimator::desiredTargetPosition() const | 75 FloatPoint ScrollAnimator::desiredTargetPosition() const |
76 { | 76 { |
77 if (m_runState == RunState::WaitingToCancelOnCompositor) | 77 if (m_runState == RunState::WaitingToCancelOnCompositor) |
78 return currentPosition(); | 78 return currentPosition(); |
79 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito
r) | 79 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito
r) |
80 ? m_targetOffset : currentPosition(); | 80 ? m_targetOffset : currentPosition(); |
81 } | 81 } |
82 | 82 |
83 bool ScrollAnimator::hasRunningAnimation() const | 83 bool ScrollAnimator::hasRunningAnimation() const |
84 { | 84 { |
85 return (m_animationCurve || m_runState == RunState::WaitingToSendToComposito
r); | 85 return m_runState != RunState::PostAnimationCleanup |
| 86 && (m_animationCurve || m_runState == RunState::WaitingToSendToComposito
r); |
86 } | 87 } |
87 | 88 |
88 FloatSize ScrollAnimator::computeDeltaToConsume(const FloatSize& delta) const | 89 FloatSize ScrollAnimator::computeDeltaToConsume(const FloatSize& delta) const |
89 { | 90 { |
90 FloatPoint pos = desiredTargetPosition(); | 91 FloatPoint pos = desiredTargetPosition(); |
91 FloatPoint newPos = toFloatPoint(m_scrollableArea->clampScrollPosition(pos +
delta)); | 92 FloatPoint newPos = toFloatPoint(m_scrollableArea->clampScrollPosition(pos +
delta)); |
92 return newPos - pos; | 93 return newPos - pos; |
93 } | 94 } |
94 | 95 |
95 void ScrollAnimator::resetAnimationState() | 96 void ScrollAnimator::resetAnimationState() |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 459 } |
459 return true; | 460 return true; |
460 } | 461 } |
461 | 462 |
462 DEFINE_TRACE(ScrollAnimator) | 463 DEFINE_TRACE(ScrollAnimator) |
463 { | 464 { |
464 ScrollAnimatorBase::trace(visitor); | 465 ScrollAnimatorBase::trace(visitor); |
465 } | 466 } |
466 | 467 |
467 } // namespace blink | 468 } // namespace blink |
OLD | NEW |