Commit b86ad9b0 authored by Adam Barth's avatar Adam Barth

RenderStack should handle top, right, bottom, left all being zero

Previously, we didn't set the width of the child correctly when top and bottom
(or left and right) were both specified.

Fixes #275
parent 67f6cab2
......@@ -155,14 +155,14 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S
BoxConstraints childConstraints = innerConstraints;
if (childData.left != null && childData.right != null)
childConstraints = childConstraints.applyWidth(childData.right - childData.left);
childConstraints = childConstraints.applyWidth(size.width - childData.right - childData.left);
else if (childData.left != null)
childConstraints = childConstraints.applyMaxWidth(size.width - childData.left);
else if (childData.right != null)
childConstraints = childConstraints.applyMaxWidth(size.width - childData.right);
if (childData.top != null && childData.bottom != null)
childConstraints = childConstraints.applyHeight(childData.bottom - childData.top);
childConstraints = childConstraints.applyHeight(size.height - childData.bottom - childData.top);
else if (childData.top != null)
childConstraints = childConstraints.applyMaxHeight(size.height - childData.top);
else if (childData.bottom != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment