Showing
1 changed file
with
6 additions
and
2 deletions
| @@ -559,12 +559,12 @@ class Table extends Widget with SpanningWidget { | @@ -559,12 +559,12 @@ class Table extends Widget with SpanningWidget { | ||
| 559 | 559 | ||
| 560 | switch (align) { | 560 | switch (align) { |
| 561 | case TableCellVerticalAlignment.bottom: | 561 | case TableCellVerticalAlignment.bottom: |
| 562 | - childY = totalHeight - child.box!.y - _heights[heightIndex]; | 562 | + childY = totalHeight - child.box!.y - _getHeight(heightIndex); |
| 563 | break; | 563 | break; |
| 564 | case TableCellVerticalAlignment.middle: | 564 | case TableCellVerticalAlignment.middle: |
| 565 | childY = totalHeight - | 565 | childY = totalHeight - |
| 566 | child.box!.y - | 566 | child.box!.y - |
| 567 | - (_heights[heightIndex] + child.box!.height) / 2; | 567 | + (_getHeight(heightIndex) + child.box!.height) / 2; |
| 568 | break; | 568 | break; |
| 569 | case TableCellVerticalAlignment.top: | 569 | case TableCellVerticalAlignment.top: |
| 570 | case TableCellVerticalAlignment.full: | 570 | case TableCellVerticalAlignment.full: |
| @@ -669,6 +669,10 @@ class Table extends Widget with SpanningWidget { | @@ -669,6 +669,10 @@ class Table extends Widget with SpanningWidget { | ||
| 669 | } | 669 | } |
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | + double _getHeight(int heightIndex) { | ||
| 673 | + return (heightIndex >= 0 && heightIndex < _heights.length) ? _heights[heightIndex] : 0.0; | ||
| 674 | + } | ||
| 675 | + | ||
| 672 | static TextAlign _textAlign(Alignment align) { | 676 | static TextAlign _textAlign(Alignment align) { |
| 673 | if (align.x == 0) { | 677 | if (align.x == 0) { |
| 674 | return TextAlign.center; | 678 | return TextAlign.center; |
-
Please register or login to post a comment