| Index: client/layout/GridLayout.dart
|
| diff --git a/client/layout/GridLayout.dart b/client/layout/GridLayout.dart
|
| index 38a3c39b3b552119418fc626977ff904eaf0703a..a3688a84dd68a0e13a3ca2f657ad9f7b66d8f0ff 100644
|
| --- a/client/layout/GridLayout.dart
|
| +++ b/client/layout/GridLayout.dart
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// Copyright (c) 2011, 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.
|
|
|
| @@ -94,19 +94,23 @@ class GridLayout extends ViewLayout {
|
| // when the grid layout is used.
|
| }
|
|
|
| + // 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. */
|
| - bool measureLayout(int width, int height) {
|
| - assert(window.inMeasurementFrame);
|
| + void measureLayout(Future<Size> size, Completer<bool> changed) {
|
| _ensureAllTracks();
|
| - _gridWidth = width;
|
| - _gridHeight = height;
|
| -
|
| - if (_rowTracks.length > 0 && _columnTracks.length > 0) {
|
| - _measureTracks();
|
| - _setBoundsOfChildren();
|
| - return true;
|
| - }
|
| - return false;
|
| + 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);
|
| + }
|
| + }
|
| + });
|
| }
|
|
|
| /**
|
|
|