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
49b43e2e
Commit
49b43e2e
authored
Aug 17, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trivial code changes for style in animation/ directory.
parent
183ea104
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
animated_simulation.dart
packages/flutter/lib/animation/animated_simulation.dart
+3
-3
forces.dart
packages/flutter/lib/animation/forces.dart
+18
-11
No files found.
packages/flutter/lib/animation/animated_simulation.dart
View file @
49b43e2e
...
...
@@ -33,11 +33,11 @@ class Ticker {
_animationId
=
null
;
}
// We take the _completer into a local variable so that !isTicking
// when we actually complete the future (isTicking uses _completer
// to determine its state).
Completer
localCompleter
=
_completer
;
_completer
=
null
;
// We take the _completer into a local variable so that !isTicking when we
// actually complete the future.
assert
(!
isTicking
);
localCompleter
.
complete
();
}
...
...
packages/flutter/lib/animation/forces.dart
View file @
49b43e2e
...
...
@@ -10,27 +10,34 @@ abstract class Force {
}
class
SpringForce
extends
Force
{
SpringForce
(
this
.
spring
,
{
this
.
left
:
0.0
,
this
.
right
:
1.0
});
// We overshoot the target by this distance, but stop the simulation when
// the spring gets within this distance (regardless of how fast it's moving).
// This causes the spring to settle a bit faster than it otherwise would.
static
final
Tolerance
tolerance
=
new
Tolerance
(
velocity:
double
.
INFINITY
,
distance:
0.01
);
SpringForce
(
this
.
spring
,
{
this
.
left
:
0.0
,
this
.
right
:
1.0
});
final
SpringDescription
spring
;
// Where to put the spring's resting point when releasing left or right,
// respectively.
final
double
left
,
right
;
// We overshoot the target by this distance, but stop the simulation when
// the spring gets within this distance (regardless of how fast it's moving).
// This causes the spring to settle a bit faster than it otherwise would.
static
final
Tolerance
tolerance
=
new
Tolerance
(
velocity:
double
.
INFINITY
,
distance:
0.01
);
Simulation
release
(
double
position
,
double
velocity
)
{
double
target
=
velocity
<
0.0
?
this
.
left
-
tolerance
.
distance
:
this
.
right
+
tolerance
.
distance
;
double
target
=
velocity
<
0.0
?
this
.
left
-
tolerance
.
distance
:
this
.
right
+
tolerance
.
distance
;
return
new
SpringSimulation
(
spring
,
position
,
target
,
velocity
)
..
tolerance
=
tolerance
;
}
}
final
SpringDescription
_kDefaultSpringDesc
=
new
SpringDescription
.
withDampingRatio
(
mass:
1.0
,
springConstant:
500.0
,
ratio:
1.0
);
final
SpringDescription
_kDefaultSpringDesc
=
new
SpringDescription
.
withDampingRatio
(
mass:
1.0
,
springConstant:
500.0
,
ratio:
1.0
);
final
SpringForce
kDefaultSpringForce
=
new
SpringForce
(
_kDefaultSpringDesc
);
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