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

Unified Diff: samples/swarm/Views.dart

Issue 11367040: Removing Element.rect. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: samples/swarm/Views.dart
diff --git a/samples/swarm/Views.dart b/samples/swarm/Views.dart
index 57b50be9519e93ba1521dccb6ec93eca194c1b66..1161d8debbea3658193028b70dc2818357a19c3f 100644
--- a/samples/swarm/Views.dart
+++ b/samples/swarm/Views.dart
@@ -220,9 +220,7 @@ class GenericListView<D> extends View {
num height = _layout.getHeight(_viewLength);
width = width != null ? width : 0;
height = height != null ? height : 0;
- final completer = new Completer<Size>();
- completer.complete(new Size(width, height));
- return completer.future;
+ return new Size(width, height);
},
_paginate && _snapToItems ?
Scroller.FAST_SNAP_DECELERATION_FACTOR : 1);
@@ -289,8 +287,8 @@ class GenericListView<D> extends View {
void onResize() {
int lastViewLength = _viewLength;
- node.rect.then((ElementRect rect) {
- _viewLength = _vertical ? rect.offset.height : rect.offset.width;
+ window.requestLayoutFrame(() {
+ _viewLength = _vertical ? node.offsetHeight : node.offsetWidth;
if (_viewLength != lastViewLength) {
if (_scrollbar != null) {
_scrollbar.refresh();

Powered by Google App Engine
This is Rietveld 408576698