| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of layout; | 5 part of layout; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Implements a grid-based layout system based on: | 8 * Implements a grid-based layout system based on: |
| 9 * [http://dev.w3.org/csswg/css3-grid-align/] | 9 * [http://dev.w3.org/csswg/css3-grid-align/] |
| 10 * | 10 * |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 373 } |
| 374 tracks = []; | 374 tracks = []; |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 /** | 379 /** |
| 380 * Returns true if we have an appropriate content sized dimension, and don't | 380 * Returns true if we have an appropriate content sized dimension, and don't |
| 381 * cross a fractional track. | 381 * cross a fractional track. |
| 382 */ | 382 */ |
| 383 static bool _hasContentSizedTracks(Collection<GridTrack> tracks, | 383 static bool _hasContentSizedTracks(Iterable<GridTrack> tracks, |
| 384 ContentSizeMode sizeMode, _BreadthAccumulator breadth) { | 384 ContentSizeMode sizeMode, _BreadthAccumulator breadth) { |
| 385 | 385 |
| 386 for (final t in tracks) { | 386 for (final t in tracks) { |
| 387 final fn = breadth.getSizingFunction(t); | 387 final fn = breadth.getSizingFunction(t); |
| 388 if (sizeMode == ContentSizeMode.MAX && fn.isMaxContentSized || | 388 if (sizeMode == ContentSizeMode.MAX && fn.isMaxContentSized || |
| 389 sizeMode == ContentSizeMode.MIN && fn.isContentSized) { | 389 sizeMode == ContentSizeMode.MIN && fn.isContentSized) { |
| 390 | 390 |
| 391 // Make sure we don't cross a fractional track | 391 // Make sure we don't cross a fractional track |
| 392 return tracks.length == 1 || !tracks.any((t_) => t_.isFractional); | 392 return tracks.length == 1 || !tracks.any((t_) => t_.isFractional); |
| 393 } | 393 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } | 512 } |
| 513 return result; | 513 return result; |
| 514 } | 514 } |
| 515 | 515 |
| 516 int _getSpanCount(ViewLayout item) { | 516 int _getSpanCount(ViewLayout item) { |
| 517 GridLayoutParams childLayout = item.layoutParams; | 517 GridLayoutParams childLayout = item.layoutParams; |
| 518 return (_dimension == Dimension.WIDTH ? | 518 return (_dimension == Dimension.WIDTH ? |
| 519 childLayout.columnSpan : childLayout.rowSpan); | 519 childLayout.columnSpan : childLayout.rowSpan); |
| 520 } | 520 } |
| 521 } | 521 } |
| OLD | NEW |