stretch and padding round 2
This commit is contained in:
@@ -512,6 +512,18 @@ describe('Layout', function() {
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
it('should layout node with inner & outer padding and stretch', function() {
|
||||
testLayout(
|
||||
{style: {padding: 50}, children: [
|
||||
{style: {padding: 10, alignSelf: 'stretch'}}
|
||||
]},
|
||||
{width: 120, height: 120, top: 0, left: 0, children: [
|
||||
{width: 20, height: 20, top: 50, left: 50}
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
it('should layout randomly', function() {
|
||||
function RNG(seed) {
|
||||
this.state = seed;
|
||||
|
@@ -203,6 +203,8 @@ function computeLayout(node) {
|
||||
leadingCrossDim += remainingCrossDim;
|
||||
} else if (alignItem === 'stretch') {
|
||||
child.layout[dim[crossAxis]] += node.layout[dim[crossAxis]] -
|
||||
getPadding(node, leading[crossAxis]) -
|
||||
getPadding(node, trailing[crossAxis]) -
|
||||
getMargin(child, leading[crossAxis]) -
|
||||
getMargin(child, trailing[crossAxis]) -
|
||||
getPadding(child, leading[crossAxis]) -
|
||||
|
Reference in New Issue
Block a user