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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 span = childLayout.columnSpan; | 499 span = childLayout.columnSpan; |
500 tracks = _columnTracks; | 500 tracks = _columnTracks; |
501 } else if (_dimension == Dimension.HEIGHT) { | 501 } else if (_dimension == Dimension.HEIGHT) { |
502 start = childLayout.row - 1; | 502 start = childLayout.row - 1; |
503 span = childLayout.rowSpan; | 503 span = childLayout.rowSpan; |
504 tracks = _rowTracks; | 504 tracks = _rowTracks; |
505 } | 505 } |
506 | 506 |
507 assert(start >= 0 && span >= 1); | 507 assert(start >= 0 && span >= 1); |
508 | 508 |
509 final result = new List<GridTrack>.fixedLength(span); | 509 final result = new List<GridTrack>(span); |
510 for (int i = 0; i < span; i++) { | 510 for (int i = 0; i < span; i++) { |
511 result[i] = tracks[start + i]; | 511 result[i] = tracks[start + i]; |
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 |