File tree Expand file tree Collapse file tree
packages/react-native/ReactCommon/yoga/yoga/algorithm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -415,12 +415,6 @@ static void measureNodeWithoutChildren(
415415 Dimension::Height);
416416}
417417
418- inline bool isFixedSize (float dim, SizingMode sizingMode) {
419- return yoga::isDefined (dim) &&
420- (sizingMode == SizingMode::StretchFit ||
421- (sizingMode == SizingMode::FitContent && dim <= 0.0 ));
422- }
423-
424418static bool measureNodeWithFixedSize (
425419 yoga::Node* const node,
426420 const Direction direction,
@@ -430,8 +424,12 @@ static bool measureNodeWithFixedSize(
430424 const SizingMode heightSizingMode,
431425 const float ownerWidth,
432426 const float ownerHeight) {
433- if (isFixedSize (availableWidth, widthSizingMode) &&
434- isFixedSize (availableHeight, heightSizingMode)) {
427+ if ((yoga::isDefined (availableWidth) &&
428+ widthSizingMode == SizingMode::FitContent && availableWidth <= 0 .0f ) ||
429+ (yoga::isDefined (availableHeight) &&
430+ heightSizingMode == SizingMode::FitContent && availableHeight <= 0 .0f ) ||
431+ (widthSizingMode == SizingMode::StretchFit &&
432+ heightSizingMode == SizingMode::StretchFit)) {
435433 node->setLayoutMeasuredDimension (
436434 boundAxis (
437435 node,
You can’t perform that action at this time.
0 commit comments