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
This commit is contained in:
Adam Barth
2015-07-30 10:08:07 -07:00
parent 67f6cab2ea
commit b86ad9b053

View File

@@ -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)