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

Unified Diff: sky/sdk/lib/animation/scroll_behavior.dart

Issue 1226373003: demo_launcher/lib/main.dart does not have bottom-overscroll (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: sky/sdk/lib/animation/scroll_behavior.dart
diff --git a/sky/sdk/lib/animation/scroll_behavior.dart b/sky/sdk/lib/animation/scroll_behavior.dart
index f94e5378a085e84ac4feef577df49b9df16fdf25..b07ee8f7c6d182101d52c90d2d29ee8d2259279e 100644
--- a/sky/sdk/lib/animation/scroll_behavior.dart
+++ b/sky/sdk/lib/animation/scroll_behavior.dart
@@ -58,17 +58,17 @@ class OverscrollBehavior extends ScrollBehavior {
: _contentsHeight = contentsHeight,
_containerHeight = containerHeight;
- double get maxScroll => math.max(0.0, _contentsHeight - _containerHeight);
+ double get maxScrollOffset => math.max(0.0, _contentsHeight - _containerHeight);
Simulation release(Particle particle) {
System system;
- if ((particle.position >= 0.0) && (particle.position < maxScroll)) {
+ if ((particle.position >= 0.0) && (particle.position < maxScrollOffset)) {
if (particle.velocity == 0.0)
return null;
System slowdownSystem = new ParticleInBoxWithFriction(
particle: particle,
friction: _kScrollFriction,
- box: new GeofenceBox(min: 0.0, max: maxScroll, onEscape: () {
+ box: new GeofenceBox(min: 0.0, max: maxScrollOffset, onEscape: () {
(system as Multisystem).transitionToSystem(new ParticleInBoxWithFriction(
particle: particle,
friction: _kOverscrollFriction,
@@ -92,9 +92,9 @@ class OverscrollBehavior extends ScrollBehavior {
targetPosition: 0.0);
return new ParticleClimbingRamp(
particle: particle,
- box: new ClosedBox(min: maxScroll),
+ box: new ClosedBox(min: maxScrollOffset),
theta: _kBounceSlopeAngle,
- targetPosition: maxScroll);
+ targetPosition: maxScrollOffset);
}
double applyCurve(double scrollOffset, double scrollDelta) {
@@ -107,8 +107,8 @@ class OverscrollBehavior extends ScrollBehavior {
// do similar things for overscroll in the other direction.
if (newScrollOffset < 0.0) {
newScrollOffset -= (newScrollOffset - math.min(0.0, scrollOffset)) / 2.0;
- } else if (newScrollOffset > maxScroll) {
- newScrollOffset -= (newScrollOffset - math.max(maxScroll, scrollOffset)) / 2.0;
+ } else if (newScrollOffset > maxScrollOffset) {
+ newScrollOffset -= (newScrollOffset - math.max(maxScrollOffset, scrollOffset)) / 2.0;
}
return newScrollOffset;
}
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/fixed_height_scrollable.dart » ('j') | sky/sdk/lib/widgets/fixed_height_scrollable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698