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

Side by Side Diff: sky/sdk/lib/framework/components2/fixed_height_scrollable.dart

Issue 1145263006: Add RenderClip and use it in FixedHeightScrollable (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698