mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert D76793705: Fix possible invalid measurements when width or height is zero pixels
Differential Revision: D76793705 Original commit changeset: ea4c00e68891 Original Phabricator Diff: D76793705 fbshipit-source-id: 95d6b66ab08e073da9fb07fd4094a7e30e2f453b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5348f9ff1e
commit
fd29d68c16
@@ -415,12 +415,6 @@ static void measureNodeWithoutChildren(
|
||||
Dimension::Height);
|
||||
}
|
||||
|
||||
inline bool isFixedSize(float dim, SizingMode sizingMode) {
|
||||
return yoga::isDefined(dim) &&
|
||||
(sizingMode == SizingMode::StretchFit ||
|
||||
(sizingMode == SizingMode::FitContent && dim <= 0.0));
|
||||
}
|
||||
|
||||
static bool measureNodeWithFixedSize(
|
||||
yoga::Node* const node,
|
||||
const Direction direction,
|
||||
@@ -430,8 +424,12 @@ static bool measureNodeWithFixedSize(
|
||||
const SizingMode heightSizingMode,
|
||||
const float ownerWidth,
|
||||
const float ownerHeight) {
|
||||
if (isFixedSize(availableWidth, widthSizingMode) &&
|
||||
isFixedSize(availableHeight, heightSizingMode)) {
|
||||
if ((yoga::isDefined(availableWidth) &&
|
||||
widthSizingMode == SizingMode::FitContent && availableWidth <= 0.0f) ||
|
||||
(yoga::isDefined(availableHeight) &&
|
||||
heightSizingMode == SizingMode::FitContent && availableHeight <= 0.0f) ||
|
||||
(widthSizingMode == SizingMode::StretchFit &&
|
||||
heightSizingMode == SizingMode::StretchFit)) {
|
||||
node->setLayoutMeasuredDimension(
|
||||
boundAxis(
|
||||
node,
|
||||
|
||||
Reference in New Issue
Block a user