Index: client/layout/GridLayout.dart |
diff --git a/client/layout/GridLayout.dart b/client/layout/GridLayout.dart |
index a3688a84dd68a0e13a3ca2f657ad9f7b66d8f0ff..afc984ebe038a11224e83f956e0727946986af26 100644 |
--- a/client/layout/GridLayout.dart |
+++ b/client/layout/GridLayout.dart |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
@@ -97,20 +97,18 @@ class GridLayout extends ViewLayout { |
// TODO(jacobr): cleanup this method so that it returns a Future |
// rather than taking a Completer as an argument. |
/** The main entry point for layout computation. */ |
- void measureLayout(Future<Size> size, Completer<bool> changed) { |
+ bool measureLayout(Size size) { |
+ assert(window.inMeasurementFrame); |
Jennifer Messerly
2012/01/13 02:19:44
nice!
|
_ensureAllTracks(); |
- window.requestLayoutFrame(() { |
- _gridWidth = size.value.width; |
- _gridHeight = size.value.height; |
- |
- if (_rowTracks.length > 0 && _columnTracks.length > 0) { |
- _measureTracks(); |
- _setBoundsOfChildren(); |
- if (changed != null) { |
- changed.complete(true); |
- } |
- } |
- }); |
+ _gridWidth = size.width; |
+ _gridHeight = size.height; |
+ |
+ if (_rowTracks.length > 0 && _columnTracks.length > 0) { |
+ _measureTracks(); |
+ _setBoundsOfChildren(); |
+ return true; |
+ } |
+ return false; |
} |
/** |