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
472c4403
Commit
472c4403
authored
Oct 03, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1474 from abarth/hit_zero
Force AnimatedVariables to hit begin on 0.0
parents
cf889934
34238dd8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
animated_value.dart
packages/flutter/lib/src/animation/animated_value.dart
+21
-9
dismissable.dart
packages/flutter/lib/src/widgets/dismissable.dart
+0
-5
No files found.
packages/flutter/lib/src/animation/animated_value.dart
View file @
472c4403
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
"dart:sky"
;
import
'dart:sky'
show
Color
,
Rect
;
import
'package:sky/src/animation/curves.dart'
;
...
...
@@ -57,13 +57,13 @@ class AnimationTiming {
Interval
interval
=
_getInterval
(
direction
);
if
(
interval
!=
null
)
t
=
interval
.
transform
(
t
);
if
(
t
==
1.0
)
// Or should we support inverse curves?
return
t
;
Curve
curve
=
_getCurve
(
direction
);
if
(
curve
!=
null
)
t
=
curve
.
transform
(
t
);
assert
(
t
>=
0.0
&&
t
<=
1.0
);
if
(
t
==
0.0
||
t
==
1.0
)
{
assert
(
t
==
_applyCurve
(
t
,
direction
).
round
().
toDouble
());
return
t
;
}
return
_applyCurve
(
t
,
direction
);
}
Interval
_getInterval
(
Direction
direction
)
{
if
(
direction
==
Direction
.
forward
||
reverseInterval
==
null
)
...
...
@@ -76,6 +76,13 @@ class AnimationTiming {
return
curve
;
return
reverseCurve
;
}
double
_applyCurve
(
double
t
,
Direction
direction
)
{
Curve
curve
=
_getCurve
(
direction
);
if
(
curve
==
null
)
return
t
;
return
curve
.
transform
(
t
);
}
}
/// An animated variable with a concrete type
...
...
@@ -101,7 +108,12 @@ class AnimatedValue<T extends dynamic> extends AnimationTiming implements Animat
void
setProgress
(
double
t
,
Direction
direction
)
{
if
(
end
!=
null
)
{
t
=
transform
(
t
,
direction
);
value
=
(
t
==
1.0
)
?
end
:
lerp
(
t
);
if
(
t
==
0.0
)
value
=
begin
;
else
if
(
t
==
1.0
)
value
=
end
;
else
value
=
lerp
(
t
);
}
}
...
...
packages/flutter/lib/src/widgets/dismissable.dart
View file @
472c4403
...
...
@@ -102,11 +102,6 @@ class DismissableState extends State<Dismissable> {
..
addListener
(
_handleResizeProgressChanged
);
_resizePerformance
.
play
();
});
// Our squash curve (ease) does not return v=0.0 for t=0.0, so we
// technically resize on the first frame. To make sure this doesn't confuse
// any other widgets (like MixedViewport, which checks for this kind of
// thing), we report a resize straight away.
_maybeCallOnResized
();
}
void
_handleResizeProgressChanged
()
{
...
...
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