fix children with left

This commit is contained in:
Christopher Chedeau
2014-12-11 15:58:45 +00:00
parent ba873aa3d7
commit ab64a5b624
2 changed files with 16 additions and 2 deletions

View File

@@ -267,8 +267,7 @@ var computeLayout = (function() {
if (getAlignItem(node, child) === CSS_ALIGN_STRETCH && if (getAlignItem(node, child) === CSS_ALIGN_STRETCH &&
getPositionType(child) === CSS_POSITION_RELATIVE && getPositionType(child) === CSS_POSITION_RELATIVE &&
!isUndefined(node.layout[dim[crossAxis]]) && !isUndefined(node.layout[dim[crossAxis]]) &&
!isDimDefined(child, crossAxis) && !isDimDefined(child, crossAxis)) {
!isPosDefined(child, leading[crossAxis])) {
child.layout[dim[crossAxis]] = fmaxf( child.layout[dim[crossAxis]] = fmaxf(
node.layout[dim[crossAxis]] - node.layout[dim[crossAxis]] -
getPaddingAndBorderAxis(node, crossAxis) - getPaddingAndBorderAxis(node, crossAxis) -

View File

@@ -1099,6 +1099,21 @@ describe('Layout', function() {
); );
}); });
it('should layout with children of a contain with left', function() {
testLayout(
{style: {width: 800}, children: [
{style: {left: 5}, children: [
{style: {}}
]}
]},
{width: 800, height: 0, top: 0, left: 0, children: [
{width: 800, height: 0, top: 0, left: 5, children: [
{width: 800, height: 0, top: 0, left: 0}
]}
]}
);
});
xit('should layout flex-wrap', function() { xit('should layout flex-wrap', function() {
testLayout( testLayout(
{style: {flexWrap: 'wrap', flexDirection: 'row', width: 100}, children: [ {style: {flexWrap: 'wrap', flexDirection: 'row', width: 100}, children: [