Move condition to the non-redundant block
No need to check for RELATIVE position when position type is ABSOLUTE and dimension is set.
This commit is contained in:
@@ -885,7 +885,6 @@ static void layoutNodeImpl(css_node_t *node, float parentMaxWidth, css_direction
|
|||||||
if (isMainDimDefined) {
|
if (isMainDimDefined) {
|
||||||
setTrailingPosition(node, child, mainAxis);
|
setTrailingPosition(node, child, mainAxis);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Now that we placed the element, we need to update the variables
|
// Now that we placed the element, we need to update the variables
|
||||||
// We only need to do that for relative elements. Absolute elements
|
// We only need to do that for relative elements. Absolute elements
|
||||||
@@ -899,6 +898,7 @@ static void layoutNodeImpl(css_node_t *node, float parentMaxWidth, css_direction
|
|||||||
crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float containerCrossAxis = node->layout.dimensions[dim[crossAxis]];
|
float containerCrossAxis = node->layout.dimensions[dim[crossAxis]];
|
||||||
if (!isCrossDimDefined) {
|
if (!isCrossDimDefined) {
|
||||||
@@ -1110,6 +1110,7 @@ static void layoutNodeImpl(css_node_t *node, float parentMaxWidth, css_direction
|
|||||||
// the axis are defined (either both left and right or top and bottom).
|
// the axis are defined (either both left and right or top and bottom).
|
||||||
for (ii = 0; ii < 2; ii++) {
|
for (ii = 0; ii < 2; ii++) {
|
||||||
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
||||||
|
|
||||||
if (!isUndefined(node->layout.dimensions[dim[axis]]) &&
|
if (!isUndefined(node->layout.dimensions[dim[axis]]) &&
|
||||||
!isDimDefined(currentAbsoluteChild, axis) &&
|
!isDimDefined(currentAbsoluteChild, axis) &&
|
||||||
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
||||||
|
@@ -753,7 +753,6 @@ var computeLayout = (function() {
|
|||||||
if (isMainDimDefined) {
|
if (isMainDimDefined) {
|
||||||
setTrailingPosition(node, child, mainAxis);
|
setTrailingPosition(node, child, mainAxis);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Now that we placed the element, we need to update the variables
|
// Now that we placed the element, we need to update the variables
|
||||||
// We only need to do that for relative elements. Absolute elements
|
// We only need to do that for relative elements. Absolute elements
|
||||||
@@ -767,6 +766,7 @@ var computeLayout = (function() {
|
|||||||
crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var/*float*/ containerCrossAxis = node.layout[dim[crossAxis]];
|
var/*float*/ containerCrossAxis = node.layout[dim[crossAxis]];
|
||||||
if (!isCrossDimDefined) {
|
if (!isCrossDimDefined) {
|
||||||
@@ -978,6 +978,7 @@ var computeLayout = (function() {
|
|||||||
// the axis are defined (either both left and right or top and bottom).
|
// the axis are defined (either both left and right or top and bottom).
|
||||||
for (ii = 0; ii < 2; ii++) {
|
for (ii = 0; ii < 2; ii++) {
|
||||||
axis = (ii !== 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
axis = (ii !== 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
||||||
|
|
||||||
if (!isUndefined(node.layout[dim[axis]]) &&
|
if (!isUndefined(node.layout[dim[axis]]) &&
|
||||||
!isDimDefined(currentAbsoluteChild, axis) &&
|
!isDimDefined(currentAbsoluteChild, axis) &&
|
||||||
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
||||||
|
@@ -702,7 +702,6 @@ public class LayoutEngine {
|
|||||||
if (isMainDimDefined) {
|
if (isMainDimDefined) {
|
||||||
setTrailingPosition(node, child, mainAxis);
|
setTrailingPosition(node, child, mainAxis);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Now that we placed the element, we need to update the variables
|
// Now that we placed the element, we need to update the variables
|
||||||
// We only need to do that for relative elements. Absolute elements
|
// We only need to do that for relative elements. Absolute elements
|
||||||
@@ -716,6 +715,7 @@ public class LayoutEngine {
|
|||||||
crossDim = Math.max(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
crossDim = Math.max(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float containerCrossAxis = node.layout.dimensions[dim[crossAxis]];
|
float containerCrossAxis = node.layout.dimensions[dim[crossAxis]];
|
||||||
if (!isCrossDimDefined) {
|
if (!isCrossDimDefined) {
|
||||||
@@ -927,6 +927,7 @@ public class LayoutEngine {
|
|||||||
// the axis are defined (either both left and right or top and bottom).
|
// the axis are defined (either both left and right or top and bottom).
|
||||||
for (ii = 0; ii < 2; ii++) {
|
for (ii = 0; ii < 2; ii++) {
|
||||||
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
||||||
|
|
||||||
if (!isUndefined(node.layout.dimensions[dim[axis]]) &&
|
if (!isUndefined(node.layout.dimensions[dim[axis]]) &&
|
||||||
!isDimDefined(currentAbsoluteChild, axis) &&
|
!isDimDefined(currentAbsoluteChild, axis) &&
|
||||||
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
isPosDefined(currentAbsoluteChild, leading[axis]) &&
|
||||||
|
Reference in New Issue
Block a user