From 1a72d91cb29d24851bf8b8cf36e683740d3945d0 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 27 Apr 2017 07:09:24 -0700 Subject: [PATCH] Remove rounding from experimental features Reviewed By: gkassabli Differential Revision: D4953838 fbshipit-source-id: 3ee5f27d92f95b3ed4a01c98bc35e9157f2e91c5 --- .../com/facebook/yoga/YogaExperimentalFeature.java | 10 ++++------ ReactCommon/yoga/yoga/YGEnums.c | 2 -- ReactCommon/yoga/yoga/YGEnums.h | 3 +-- ReactCommon/yoga/yoga/Yoga.c | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java index 1ac1f9b35..178ece402 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java @@ -13,9 +13,8 @@ import com.facebook.proguard.annotations.DoNotStrip; @DoNotStrip public enum YogaExperimentalFeature { - ROUNDING(0), - WEB_FLEX_BASIS(1), - MIN_FLEX_FIX(2); + WEB_FLEX_BASIS(0), + MIN_FLEX_FIX(1); private int mIntValue; @@ -29,9 +28,8 @@ public enum YogaExperimentalFeature { public static YogaExperimentalFeature fromInt(int value) { switch (value) { - case 0: return ROUNDING; - case 1: return WEB_FLEX_BASIS; - case 2: return MIN_FLEX_FIX; + case 0: return WEB_FLEX_BASIS; + case 1: return MIN_FLEX_FIX; default: throw new IllegalArgumentException("Unknown enum value: " + value); } } diff --git a/ReactCommon/yoga/yoga/YGEnums.c b/ReactCommon/yoga/yoga/YGEnums.c index 0108e6a61..c3e4521c0 100644 --- a/ReactCommon/yoga/yoga/YGEnums.c +++ b/ReactCommon/yoga/yoga/YGEnums.c @@ -89,8 +89,6 @@ const char *YGEdgeToString(const YGEdge value){ const char *YGExperimentalFeatureToString(const YGExperimentalFeature value){ switch(value){ - case YGExperimentalFeatureRounding: - return "rounding"; case YGExperimentalFeatureWebFlexBasis: return "web-flex-basis"; case YGExperimentalFeatureMinFlexFix: diff --git a/ReactCommon/yoga/yoga/YGEnums.h b/ReactCommon/yoga/yoga/YGEnums.h index 8a929b9e7..972c5210f 100644 --- a/ReactCommon/yoga/yoga/YGEnums.h +++ b/ReactCommon/yoga/yoga/YGEnums.h @@ -62,9 +62,8 @@ typedef YG_ENUM_BEGIN(YGEdge) { } YG_ENUM_END(YGEdge); WIN_EXPORT const char *YGEdgeToString(const YGEdge value); -#define YGExperimentalFeatureCount 3 +#define YGExperimentalFeatureCount 2 typedef YG_ENUM_BEGIN(YGExperimentalFeature) { - YGExperimentalFeatureRounding, YGExperimentalFeatureWebFlexBasis, YGExperimentalFeatureMinFlexFix, } YG_ENUM_END(YGExperimentalFeature); diff --git a/ReactCommon/yoga/yoga/Yoga.c b/ReactCommon/yoga/yoga/Yoga.c index 12ec5c5cd..2ec842875 100644 --- a/ReactCommon/yoga/yoga/Yoga.c +++ b/ReactCommon/yoga/yoga/Yoga.c @@ -202,7 +202,6 @@ static YGNode gYGNodeDefaults = { static YGConfig gYGConfigDefaults = { .experimentalFeatures = { - [YGExperimentalFeatureRounding] = false, [YGExperimentalFeatureMinFlexFix] = false, [YGExperimentalFeatureWebFlexBasis] = false, }, @@ -3386,10 +3385,7 @@ void YGNodeCalculateLayout(const YGNodeRef node, "initial", node->config)) { YGNodeSetPosition(node, node->layout.direction, parentWidth, parentHeight, parentWidth); - - if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureRounding)) { - YGRoundToPixelGrid(node, node->config->pointScaleFactor, 0.0f, 0.0f); - } + YGRoundToPixelGrid(node, node->config->pointScaleFactor, 0.0f, 0.0f); if (gPrintTree) { YGNodePrint(node, YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle);