From a22194b6c0384a2e5f059ccd1364205c261886a4 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 22 Apr 2014 11:44:19 -0700 Subject: [PATCH] support border and position absolute for cross axis --- src/Layout.js | 1 + src/__tests__/Layout-test.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Layout.js b/src/Layout.js index 0126b08b..caa2c228 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -307,6 +307,7 @@ var computeLayout = (function() { } else { if (isPosDefined(child, leading[crossAxis])) { child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) + + getBorder(node, leading[crossAxis]) + getMargin(child, leading[crossAxis]); } else { child.layout[pos[crossAxis]] += getPaddingAndBorder(node, leading[crossAxis]); diff --git a/src/__tests__/Layout-test.js b/src/__tests__/Layout-test.js index 4e2755ce..8d6e2052 100755 --- a/src/__tests__/Layout-test.js +++ b/src/__tests__/Layout-test.js @@ -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() {