| Index: sky/sdk/lib/rendering/flex.dart
|
| diff --git a/sky/sdk/lib/rendering/flex.dart b/sky/sdk/lib/rendering/flex.dart
|
| index 52f02aee1dd83f629ef46ceca45c7d9ae43b268a..022a2d463e44fc7e40c9f52de39a0130e8a79d08 100644
|
| --- a/sky/sdk/lib/rendering/flex.dart
|
| +++ b/sky/sdk/lib/rendering/flex.dart
|
| @@ -10,12 +10,14 @@ import 'object.dart';
|
| class FlexBoxParentData extends BoxParentData with ContainerParentDataMixin<RenderBox> {
|
| int flex;
|
|
|
| + @override
|
| void merge(FlexBoxParentData other) {
|
| if (other.flex != null)
|
| flex = other.flex;
|
| super.merge(other);
|
| }
|
|
|
| + @override
|
| String toString() => '${super.toString()}; flex=$flex';
|
| }
|
|
|
| @@ -74,6 +76,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| }
|
| }
|
|
|
| + @override
|
| void setupParentData(RenderBox child) {
|
| if (child.parentData is! FlexBoxParentData)
|
| child.parentData = new FlexBoxParentData();
|
| @@ -159,13 +162,13 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| switch (_direction) {
|
| case FlexDirection.horizontal:
|
| mainSize = child.getMaxIntrinsicWidth(childConstraints);
|
| - BoxConstraints widthConstraints =
|
| + BoxConstraints widthConstraints =
|
| new BoxConstraints(minWidth: mainSize, maxWidth: mainSize);
|
| crossSize = child.getMaxIntrinsicHeight(widthConstraints);
|
| break;
|
| case FlexDirection.vertical:
|
| mainSize = child.getMaxIntrinsicHeight(childConstraints);
|
| - BoxConstraints heightConstraints =
|
| + BoxConstraints heightConstraints =
|
| new BoxConstraints(minWidth: mainSize, maxWidth: mainSize);
|
| crossSize = child.getMaxIntrinsicWidth(heightConstraints);
|
| break;
|
| @@ -189,7 +192,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| double crossSize;
|
| switch (_direction) {
|
| case FlexDirection.horizontal:
|
| - BoxConstraints childConstraints =
|
| + BoxConstraints childConstraints =
|
| new BoxConstraints(minWidth: childMainSize, maxWidth: childMainSize);
|
| crossSize = child.getMaxIntrinsicHeight(childConstraints);
|
| break;
|
| @@ -215,6 +218,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| }
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicWidth(BoxConstraints constraints) {
|
| return _getIntrinsicSize(
|
| constraints: constraints,
|
| @@ -223,6 +227,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| );
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicWidth(BoxConstraints constraints) {
|
| return _getIntrinsicSize(
|
| constraints: constraints,
|
| @@ -231,6 +236,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| );
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicSize(
|
| constraints: constraints,
|
| @@ -239,6 +245,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| );
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicSize(
|
| constraints: constraints,
|
| @@ -246,6 +253,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| childSize: (c, innerConstraints) => c.getMaxIntrinsicHeight(innerConstraints));
|
| }
|
|
|
| + @override
|
| double computeDistanceToActualBaseline(TextBaseline baseline) {
|
| if (_direction == FlexDirection.horizontal)
|
| return defaultComputeDistanceToHighestActualBaseline(baseline);
|
| @@ -265,6 +273,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| return (_direction == FlexDirection.horizontal) ? child.size.width : child.size.height;
|
| }
|
|
|
| + @override
|
| void performLayout() {
|
| // Based on http://www.w3.org/TR/css-flexbox-1/ Section 9.7 Resolving Flexible Lengths
|
| // Steps 1-3. Determine used flex factor, size inflexible items, calculate free space
|
| @@ -389,10 +398,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
| }
|
| }
|
|
|
| + @override
|
| void hitTestChildren(HitTestResult result, { Point position }) {
|
| defaultHitTestChildren(result, position: position);
|
| }
|
|
|
| + @override
|
| void paint(PaintingCanvas canvas, Offset offset) {
|
| defaultPaint(canvas, offset);
|
| }
|
|
|