support border and position absolute for cross axis
This commit is contained in:
@@ -307,6 +307,7 @@ var computeLayout = (function() {
|
|||||||
} else {
|
} else {
|
||||||
if (isPosDefined(child, leading[crossAxis])) {
|
if (isPosDefined(child, leading[crossAxis])) {
|
||||||
child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) +
|
child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) +
|
||||||
|
getBorder(node, leading[crossAxis]) +
|
||||||
getMargin(child, leading[crossAxis]);
|
getMargin(child, leading[crossAxis]);
|
||||||
} else {
|
} else {
|
||||||
child.layout[pos[crossAxis]] += getPaddingAndBorder(node, leading[crossAxis]);
|
child.layout[pos[crossAxis]] += getPaddingAndBorder(node, leading[crossAxis]);
|
||||||
|
@@ -700,6 +700,18 @@ describe('Layout', function() {
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should layout node with borderWidth and position: absolute, top. cross axis', function() {
|
||||||
|
testLayout(
|
||||||
|
{style: {borderWidth: 1}, children: [
|
||||||
|
{style: {left: 5, position: 'absolute'}}
|
||||||
|
]},
|
||||||
|
{width: 2, height: 2, top: 0, left: 0, children: [
|
||||||
|
{width: 0, height: 0, top: 1, left: 6}
|
||||||
|
]}
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it('should layout randomly', function() {
|
it('should layout randomly', function() {
|
||||||
|
Reference in New Issue
Block a user