flex and main axis margin
This commit is contained in:
@@ -208,7 +208,9 @@ var computeLayout = (function() {
|
||||
for (var/*int*/ i = 0; i < node.children.length; ++i) {
|
||||
var/*css_node_t**/ child = node.children[i];
|
||||
if (getFlex(child)) {
|
||||
child.layout[dim[mainAxis]] = flexibleMainDim;
|
||||
child.layout[dim[mainAxis]] = flexibleMainDim -
|
||||
getMargin(child, leading[mainAxis]) -
|
||||
getMargin(child, trailing[mainAxis]);
|
||||
layoutNode(child);
|
||||
}
|
||||
}
|
||||
|
@@ -606,7 +606,18 @@ describe('Layout', function() {
|
||||
{width: 0, height: 0, top: 100, left: 0}
|
||||
]}
|
||||
);
|
||||
})
|
||||
});
|
||||
|
||||
it('should llll', function() {
|
||||
testLayout(
|
||||
{style: {width: 700, flexDirection: 'row'}, children: [
|
||||
{style: {marginLeft: 5, flex: 1}}
|
||||
]},
|
||||
{width: 700, height: 0, top: 0, left: 0, children: [
|
||||
{width: 695, height: 0, top: 0, left: 5}
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
it('should layout randomly', function() {
|
||||
function RNG(seed) {
|
||||
|
Reference in New Issue
Block a user