Reset child position/sizes before calculating layout

This commit is contained in:
Pieter De Baets
2016-03-25 22:37:00 +01:00
parent 8d5cdd4e6c
commit b157ab4a00
9 changed files with 334 additions and 14 deletions

View File

@@ -41,7 +41,6 @@ describe('Javascript Only', function() {
});
});
describe('Layout', function() {
it('should layout a single node with width and height', function() {
testLayout({
@@ -2459,6 +2458,31 @@ describe('Layout', function() {
]}
);
});
it('should center items correctly inside a stretched layout', function() {
testLayout(
{style: {flexDirection: 'row'}, children: [
{style: {}, children: [
{style: {width: 100, height: 100}}
]},
{style: {width: 100}, children: [
{style: {flexDirection: 'column', alignItems: 'center'}, children: [
{style: {width: 50, height: 50}},
]},
]},
]},
{width: 200, height: 100, top: 0, left: 0, children: [
{width: 100, height: 100, top: 0, left: 0, children: [
{width: 100, height: 100, top: 0, left: 0}
]},
{width: 100, height: 100, top: 0, left: 100, children: [
{width: 100, height: 50, top: 0, left: 0, children: [
{width: 50, height: 50, top: 0, left: 25}
]},
]},
]}
);
});
});
describe('Layout alignContent', function() {