| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import '../animation/scroll_behavior.dart'; | 5 import '../animation/scroll_behavior.dart'; |
| 6 import '../fn2.dart'; | 6 import '../fn2.dart'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 import 'package:vector_math/vector_math.dart'; | 9 import 'package:vector_math/vector_math.dart'; |
| 10 import 'scrollable.dart'; | 10 import 'scrollable.dart'; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (alignmentDelta != 0.0) | 63 if (alignmentDelta != 0.0) |
| 64 alignmentDelta -= _itemHeight; | 64 alignmentDelta -= _itemHeight; |
| 65 | 65 |
| 66 double drawStart = scrollOffset + alignmentDelta; | 66 double drawStart = scrollOffset + alignmentDelta; |
| 67 itemNumber = math.max(0, (drawStart / _itemHeight).floor()); | 67 itemNumber = math.max(0, (drawStart / _itemHeight).floor()); |
| 68 | 68 |
| 69 transform.translate(0.0, alignmentDelta); | 69 transform.translate(0.0, alignmentDelta); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 // TODO(abarth): Add a clip. | 73 return new Clip( |
| 74 return new BlockContainer( | 74 child: new Transform( |
| 75 children: [ | 75 transform: transform, |
| 76 new Transform( | 76 child: new BlockContainer(children: buildItems(itemNumber, drawCount)) |
| 77 transform: transform, | 77 ) |
| 78 child: new BlockContainer(children: buildItems(itemNumber, drawCount)) | |
| 79 ) | |
| 80 ] | |
| 81 ); | 78 ); |
| 82 } | 79 } |
| 83 | 80 |
| 84 List<UINode> buildItems(int start, int count); | 81 List<UINode> buildItems(int start, int count); |
| 85 } | 82 } |
| OLD | NEW |