Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: ui/gfx/animation/slide_animation.cc

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/animation/slide_animation.h ('k') | ui/gfx/animation/slide_animation_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/animation/slide_animation.h" 5 #include "ui/gfx/animation/slide_animation.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 namespace ui { 9 namespace gfx {
10 10
11 // How many frames per second to target. 11 // How many frames per second to target.
12 static const int kDefaultFrameRateHz = 60; 12 static const int kDefaultFrameRateHz = 60;
13 13
14 // How long animations should take by default. 14 // How long animations should take by default.
15 static const int kDefaultDurationMs = 120; 15 static const int kDefaultDurationMs = 120;
16 16
17 SlideAnimation::SlideAnimation(AnimationDelegate* target) 17 SlideAnimation::SlideAnimation(AnimationDelegate* target)
18 : LinearAnimation(kDefaultFrameRateHz, target), 18 : LinearAnimation(kDefaultFrameRateHz, target),
19 target_(target), 19 target_(target),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 value_current_ = value_end_; 104 value_current_ = value_end_;
105 105
106 // Correct for any overshoot (while state may be capped at 1.0, let's not 106 // Correct for any overshoot (while state may be capped at 1.0, let's not
107 // take any rounding error chances. 107 // take any rounding error chances.
108 if ((value_end_ >= value_start_ && value_current_ > value_end_) || 108 if ((value_end_ >= value_start_ && value_current_ > value_end_) ||
109 (value_end_ < value_start_ && value_current_ < value_end_)) { 109 (value_end_ < value_start_ && value_current_ < value_end_)) {
110 value_current_ = value_end_; 110 value_current_ = value_end_;
111 } 111 }
112 } 112 }
113 113
114 } // namespace ui 114 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/animation/slide_animation.h ('k') | ui/gfx/animation/slide_animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698