Fix dimension check for STRETCH children

The correct check is on the layout state, no the style.
This commit is contained in:
Lucas Rocha
2015-09-09 09:40:23 +01:00
parent 9a149c83ff
commit 909c14117f
3 changed files with 3 additions and 3 deletions

View File

@@ -934,7 +934,7 @@ static void layoutNodeImpl(css_node_t *node, float parentMaxWidth, css_direction
if (alignItem == CSS_ALIGN_STRETCH) { if (alignItem == CSS_ALIGN_STRETCH) {
// You can only stretch if the dimension has not already been set // You can only stretch if the dimension has not already been set
// previously. // previously.
if (!isDimDefined(child, crossAxis)) { if (isUndefined(child->layout.dimensions[dim[crossAxis]])) {
child->layout.dimensions[dim[crossAxis]] = fmaxf( child->layout.dimensions[dim[crossAxis]] = fmaxf(
boundAxis(child, crossAxis, containerCrossAxis - boundAxis(child, crossAxis, containerCrossAxis -
paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)), paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)),

View File

@@ -802,7 +802,7 @@ var computeLayout = (function() {
if (alignItem === CSS_ALIGN_STRETCH) { if (alignItem === CSS_ALIGN_STRETCH) {
// You can only stretch if the dimension has not already been set // You can only stretch if the dimension has not already been set
// previously. // previously.
if (!isDimDefined(child, crossAxis)) { if (isUndefined(child.layout[dim[crossAxis]])) {
child.layout[dim[crossAxis]] = fmaxf( child.layout[dim[crossAxis]] = fmaxf(
boundAxis(child, crossAxis, containerCrossAxis - boundAxis(child, crossAxis, containerCrossAxis -
paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)), paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)),

View File

@@ -751,7 +751,7 @@ public class LayoutEngine {
if (alignItem == CSSAlign.STRETCH) { if (alignItem == CSSAlign.STRETCH) {
// You can only stretch if the dimension has not already been set // You can only stretch if the dimension has not already been set
// previously. // previously.
if (!isDimDefined(child, crossAxis)) { if (isUndefined(child.layout.dimensions[dim[crossAxis]])) {
child.layout.dimensions[dim[crossAxis]] = Math.max( child.layout.dimensions[dim[crossAxis]] = Math.max(
boundAxis(child, crossAxis, containerCrossAxis - boundAxis(child, crossAxis, containerCrossAxis -
paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)), paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)),