From 51957d564537907bb0a1c679cb75a3adcd3a0cca Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 12 Jun 2014 11:36:57 -0700 Subject: [PATCH] main axis padding --- src/Layout.js | 2 +- src/__tests__/Layout-test.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Layout.js b/src/Layout.js index b0ad944c..33960242 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -489,7 +489,7 @@ var computeLayout = (function() { child.layout[pos[mainAxis]] - getMargin(child, trailing[mainAxis]) - getPosition(child, trailing[mainAxis]) - ); + ) + getPaddingAndBorderAxis(child, mainAxis); } } } diff --git a/src/__tests__/Layout-test.js b/src/__tests__/Layout-test.js index fc83760e..352bb248 100755 --- a/src/__tests__/Layout-test.js +++ b/src/__tests__/Layout-test.js @@ -961,6 +961,17 @@ describe('Layout', function() { ); }); + it('should layout with position absolute top, bottom and padding', function() { + testLayout( + {style: {}, children: [ + {style: {top: 5, bottom: 5, paddingTop: 5, position: 'absolute'}} + ]}, + {width: 0, height: 0, top: 0, left: 0, children: [ + {width: 0, height: 5, top: 5, left: 0} + ]} + ); + }); + xit('should layout text with alignItems: stretch', function() { testLayout( {style: {width: 80, padding: 7, alignItems: 'stretch', measure: text('loooooooooong with space')}},