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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return endValue - startValue; | 183 return endValue - startValue; |
184 } | 184 } |
185 | 185 |
186 double ScrollAnimatorNone::PerAxisData::releaseArea(Curve curve, double startT,
double endT) | 186 double ScrollAnimatorNone::PerAxisData::releaseArea(Curve curve, double startT,
double endT) |
187 { | 187 { |
188 double startValue = curveIntegralAt(curve, 1 - endT); | 188 double startValue = curveIntegralAt(curve, 1 - endT); |
189 double endValue = curveIntegralAt(curve, 1 - startT); | 189 double endValue = curveIntegralAt(curve, 1 - startT); |
190 return endValue - startValue; | 190 return endValue - startValue; |
191 } | 191 } |
192 | 192 |
193 ScrollAnimatorNone::PerAxisData::PerAxisData(ScrollAnimatorNone* parent, float*
currentPosition, int visibleLength) | 193 ScrollAnimatorNone::PerAxisData::PerAxisData(float* currentPosition, int visible
Length) |
194 : m_currentPosition(currentPosition) | 194 : m_currentPosition(currentPosition) |
195 , m_visibleLength(visibleLength) | 195 , m_visibleLength(visibleLength) |
196 { | 196 { |
197 reset(); | 197 reset(); |
198 } | 198 } |
199 | 199 |
200 void ScrollAnimatorNone::PerAxisData::reset() | 200 void ScrollAnimatorNone::PerAxisData::reset() |
201 { | 201 { |
202 m_currentVelocity = 0; | 202 m_currentVelocity = 0; |
203 | 203 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return true; | 358 return true; |
359 } | 359 } |
360 | 360 |
361 void ScrollAnimatorNone::PerAxisData::updateVisibleLength(int visibleLength) | 361 void ScrollAnimatorNone::PerAxisData::updateVisibleLength(int visibleLength) |
362 { | 362 { |
363 m_visibleLength = visibleLength; | 363 m_visibleLength = visibleLength; |
364 } | 364 } |
365 | 365 |
366 ScrollAnimatorNone::ScrollAnimatorNone(ScrollableArea* scrollableArea) | 366 ScrollAnimatorNone::ScrollAnimatorNone(ScrollableArea* scrollableArea) |
367 : ScrollAnimator(scrollableArea) | 367 : ScrollAnimator(scrollableArea) |
368 , m_horizontalData(this, &m_currentPosX, scrollableArea->visibleWidth()) | 368 , m_horizontalData(&m_currentPosX, scrollableArea->visibleWidth()) |
369 , m_verticalData(this, &m_currentPosY, scrollableArea->visibleHeight()) | 369 , m_verticalData(&m_currentPosY, scrollableArea->visibleHeight()) |
370 , m_startTime(0) | 370 , m_startTime(0) |
371 , m_animationActive(false) | 371 , m_animationActive(false) |
372 { | 372 { |
373 } | 373 } |
374 | 374 |
375 ScrollAnimatorNone::~ScrollAnimatorNone() | 375 ScrollAnimatorNone::~ScrollAnimatorNone() |
376 { | 376 { |
377 stopAnimationTimerIfNeeded(); | 377 stopAnimationTimerIfNeeded(); |
378 } | 378 } |
379 | 379 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 return m_animationActive; | 516 return m_animationActive; |
517 } | 517 } |
518 | 518 |
519 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() | 519 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() |
520 { | 520 { |
521 if (animationTimerActive()) | 521 if (animationTimerActive()) |
522 m_animationActive = false; | 522 m_animationActive = false; |
523 } | 523 } |
524 | 524 |
525 } // namespace blink | 525 } // namespace blink |
OLD | NEW |