Avoid extra work when justifyContent is FLEX_START

Remaining space and between space only need to be updated when
justifyContent is not FLEX_START.
This commit is contained in:
Lucas Rocha
2015-09-08 17:03:24 +01:00
parent 2321165d53
commit 9a149c83ff
3 changed files with 4 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ var computeLayout = (function() {
var CSS_FLEX_DIRECTION_COLUMN = 'column';
var CSS_FLEX_DIRECTION_COLUMN_REVERSE = 'column-reverse';
// var CSS_JUSTIFY_FLEX_START = 'flex-start';
var CSS_JUSTIFY_FLEX_START = 'flex-start';
var CSS_JUSTIFY_CENTER = 'center';
var CSS_JUSTIFY_FLEX_END = 'flex-end';
var CSS_JUSTIFY_SPACE_BETWEEN = 'space-between';
@@ -701,7 +701,7 @@ var computeLayout = (function() {
// We use justifyContent to figure out how to allocate the remaining
// space available
} else {
} else if (getJustifyContent(node) !== CSS_JUSTIFY_FLEX_START) {
var/*css_justify_t*/ justifyContent = getJustifyContent(node);
if (justifyContent === CSS_JUSTIFY_CENTER) {
leadingMainDim = remainingMainDim / 2;