From fccb3a4ba2f27ea4b72106690b7d22162479e5a7 Mon Sep 17 00:00:00 2001 From: Sarang Gokhale Date: Mon, 1 Jul 2019 16:46:19 -0700 Subject: [PATCH 1/3] Yoga: call getMeasure even when YGMeasureModeExactly --- ReactCommon/yoga/yoga/Yoga.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3f65092b69fa2d..3c8e84a57f39ea 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1669,6 +1669,16 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( : YGFloatMax( 0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn); + // Measure the text under the current constraints. + const YGSize measuredSize = marker::MarkerSection::wrap( + node, + node->getMeasure(), + node, + innerWidth, + widthMeasureMode, + innerHeight, + heightMeasureMode); + if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) { // Don't bother sizing the text if both dimensions are already defined. @@ -1689,16 +1699,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( ownerWidth), YGDimensionHeight); } else { - // Measure the text under the current constraints. - const YGSize measuredSize = marker::MarkerSection::wrap( - node, - node->getMeasure(), - node, - innerWidth, - widthMeasureMode, - innerHeight, - heightMeasureMode); - node->setLayoutMeasuredDimension( YGNodeBoundAxis( node, From d425d08e86e3d4b20b93ba1e5267e60e048f69dc Mon Sep 17 00:00:00 2001 From: Sarang Gokhale Date: Mon, 1 Jul 2019 16:50:23 -0700 Subject: [PATCH 2/3] Revert "Yoga: call getMeasure even when YGMeasureModeExactly" This reverts commit fccb3a4ba2f27ea4b72106690b7d22162479e5a7. --- ReactCommon/yoga/yoga/Yoga.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3c8e84a57f39ea..3f65092b69fa2d 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1669,16 +1669,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( : YGFloatMax( 0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn); - // Measure the text under the current constraints. - const YGSize measuredSize = marker::MarkerSection::wrap( - node, - node->getMeasure(), - node, - innerWidth, - widthMeasureMode, - innerHeight, - heightMeasureMode); - if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) { // Don't bother sizing the text if both dimensions are already defined. @@ -1699,6 +1689,16 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( ownerWidth), YGDimensionHeight); } else { + // Measure the text under the current constraints. + const YGSize measuredSize = marker::MarkerSection::wrap( + node, + node->getMeasure(), + node, + innerWidth, + widthMeasureMode, + innerHeight, + heightMeasureMode); + node->setLayoutMeasuredDimension( YGNodeBoundAxis( node, From d0db29bee9672b037edc150d47f19d32f5e2d77a Mon Sep 17 00:00:00 2001 From: Sarang Gokhale Date: Mon, 1 Jul 2019 16:53:06 -0700 Subject: [PATCH 3/3] Yoga: call getMeasure even when YGMeasureModeExactly --- ReactCommon/yoga/yoga/Yoga.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3f65092b69fa2d..3c8e84a57f39ea 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1669,6 +1669,16 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( : YGFloatMax( 0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn); + // Measure the text under the current constraints. + const YGSize measuredSize = marker::MarkerSection::wrap( + node, + node->getMeasure(), + node, + innerWidth, + widthMeasureMode, + innerHeight, + heightMeasureMode); + if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) { // Don't bother sizing the text if both dimensions are already defined. @@ -1689,16 +1699,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( ownerWidth), YGDimensionHeight); } else { - // Measure the text under the current constraints. - const YGSize measuredSize = marker::MarkerSection::wrap( - node, - node->getMeasure(), - node, - innerWidth, - widthMeasureMode, - innerHeight, - heightMeasureMode); - node->setLayoutMeasuredDimension( YGNodeBoundAxis( node,