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
8a46b15b
Commit
8a46b15b
authored
Oct 01, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1429 from HansMuller/add_clamped_simulation
Add clamped simulation
parents
d96cbdd0
30a8e04b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
animation.dart
packages/flutter/lib/animation.dart
+1
-0
clamped_simulation.dart
packages/flutter/lib/src/animation/clamped_simulation.dart
+28
-0
No files found.
packages/flutter/lib/animation.dart
View file @
8a46b15b
...
...
@@ -10,6 +10,7 @@ library animation;
export
'src/animation/animated_simulation.dart'
;
export
'src/animation/animated_value.dart'
;
export
'src/animation/animation_performance.dart'
;
export
'src/animation/clamped_simulation.dart'
;
export
'src/animation/curves.dart'
;
export
'src/animation/forces.dart'
;
export
'src/animation/scheduler.dart'
;
...
...
packages/flutter/lib/src/animation/clamped_simulation.dart
0 → 100644
View file @
8a46b15b
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:newton/newton.dart'
;
class
ClampedSimulation
extends
Simulation
{
ClampedSimulation
(
this
.
simulation
,
{
this
.
xMin
:
double
.
NEGATIVE_INFINITY
,
this
.
xMax
:
double
.
INFINITY
,
this
.
dxMin
:
double
.
NEGATIVE_INFINITY
,
this
.
dxMax
:
double
.
INFINITY
})
{
assert
(
simulation
!=
null
);
assert
(
xMax
>=
xMin
);
assert
(
dxMax
>=
dxMin
);
}
final
Simulation
simulation
;
final
double
xMin
;
final
double
xMax
;
final
double
dxMin
;
final
double
dxMax
;
double
x
(
double
time
)
=>
simulation
.
x
(
time
).
clamp
(
xMin
,
xMax
);
double
dx
(
double
time
)
=>
simulation
.
dx
(
time
).
clamp
(
dxMin
,
dxMax
);
bool
isDone
(
double
time
)
=>
simulation
.
isDone
(
time
);
}
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