Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
755a180a
Commit
755a180a
authored
Feb 24, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2128 from abarth/animation_bounds
Keep AnimationController's _value in bounds
parents
dc4830b0
9e45b85e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
animation_controller.dart
packages/flutter/lib/src/animation/animation_controller.dart
+3
-3
No files found.
packages/flutter/lib/src/animation/animation_controller.dart
View file @
755a180a
...
...
@@ -88,7 +88,7 @@ class AnimationController extends Animation<double>
/// The current value of the animation.
///
/// Setting this value stops the current animation.
double
get
value
=>
_value
.
clamp
(
lowerBound
,
upperBound
)
;
double
get
value
=>
_value
;
double
_value
;
void
set
value
(
double
newValue
)
{
assert
(
newValue
!=
null
);
...
...
@@ -174,7 +174,7 @@ class AnimationController extends Animation<double>
assert
(
simulation
!=
null
);
assert
(!
isAnimating
);
_simulation
=
simulation
;
_value
=
simulation
.
x
(
0.0
);
_value
=
simulation
.
x
(
0.0
)
.
clamp
(
lowerBound
,
upperBound
)
;
return
_ticker
.
start
();
}
...
...
@@ -200,7 +200,7 @@ class AnimationController extends Animation<double>
void
_tick
(
Duration
elapsed
)
{
double
elapsedInSeconds
=
elapsed
.
inMicroseconds
.
toDouble
()
/
Duration
.
MICROSECONDS_PER_SECOND
;
_value
=
_simulation
.
x
(
elapsedInSeconds
);
_value
=
_simulation
.
x
(
elapsedInSeconds
)
.
clamp
(
lowerBound
,
upperBound
)
;
if
(
_simulation
.
isDone
(
elapsedInSeconds
))
stop
();
notifyListeners
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment