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

Unified Diff: sky/framework/components/fixed_height_scrollable.dart

Issue 1117143003: [Effen] Port fn.dart from the legacy sky.Node backend to the RenderNode backend, which is currently… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Tweak debug functions as suggested Created 5 years, 7 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
« no previous file with comments | « no previous file | sky/framework/components/ink_splash.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/fixed_height_scrollable.dart
diff --git a/sky/framework/components/fixed_height_scrollable.dart b/sky/framework/components/fixed_height_scrollable.dart
index 3f3e973d8b3e3d36c1f46ed81ce5b515aaf037cb..2838acbfa6a230bf32d0549c7c123b92ac17c023 100644
--- a/sky/framework/components/fixed_height_scrollable.dart
+++ b/sky/framework/components/fixed_height_scrollable.dart
@@ -6,7 +6,6 @@ import '../animation/scroll_behavior.dart';
import '../debug/tracing.dart';
import '../fn.dart';
import 'dart:math' as math;
-import 'dart:sky' as sky;
import 'dart:async';
import 'scrollable.dart';
@@ -52,14 +51,11 @@ abstract class FixedHeightScrollable extends Scrollable {
var item = root.firstChild.firstChild;
if (item == null)
return;
- sky.ClientRect scrollRect = root.getBoundingClientRect();
- sky.ClientRect itemRect = item.getBoundingClientRect();
- assert(scrollRect.height > 0);
- assert(itemRect.height > 0);
-
setState(() {
- _height = scrollRect.height;
- _itemHeight = itemRect.height;
+ _height = root.height;
+ assert(_height > 0);
+ _itemHeight = item.height;
+ assert(_itemHeight > 0);
scrollBehavior.containerHeight = _height;
scrollBehavior.contentsHeight = _itemHeight * _itemCount;
});
@@ -82,7 +78,6 @@ abstract class FixedHeightScrollable extends Scrollable {
'transform: translateY(${(-scrollOffset).toStringAsFixed(2)}px)';
} else {
drawCount = (_height / _itemHeight).round() + 1;
- double alignmentOffset = math.max(0.0, scrollOffset);
double alignmentDelta = -scrollOffset % _itemHeight;
if (alignmentDelta != 0.0)
alignmentDelta -= _itemHeight;
« no previous file with comments | « no previous file | sky/framework/components/ink_splash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698