File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ struct YGConfig {
215
215
bool experimentalFeatures[YGExperimentalFeatureCount + 1 ];
216
216
bool useWebDefaults;
217
217
bool useLegacyStretchBehaviour;
218
+ bool shouldDiffLayoutWithoutLegacyStretchBehaviour;
218
219
float pointScaleFactor;
219
220
YGLogger logger;
220
221
YGNodeClonedFunc cloneNodeCallback;
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ static YGConfig gYGConfigDefaults = {
47
47
},
48
48
.useWebDefaults = false ,
49
49
.useLegacyStretchBehaviour = false ,
50
+ .shouldDiffLayoutWithoutLegacyStretchBehaviour = false ,
50
51
.pointScaleFactor = 1 .0f ,
51
52
#ifdef ANDROID
52
53
.logger = &YGAndroidLog,
@@ -3613,14 +3614,15 @@ void YGNodeCalculateLayout(const YGNodeRef node,
3613
3614
}
3614
3615
}
3615
3616
3616
- bool didUseLegacyFlag = node->didUseLegacyFlag ();
3617
-
3618
3617
// We want to get rid off `useLegacyStretchBehaviour` from YGConfig. But we
3619
3618
// aren't sure whether client's of yoga have gotten rid off this flag or not.
3620
3619
// So logging this in YGLayout would help to find out the call sites depending
3621
3620
// on this flag. This check would be removed once we are sure no one is
3622
- // dependent on this flag anymore.
3623
- if (didUseLegacyFlag) {
3621
+ // dependent on this flag anymore. The flag
3622
+ // `shouldDiffLayoutWithoutLegacyStretchBehaviour` in YGConfig will help to
3623
+ // run experiments.
3624
+ if (node->getConfig ()->shouldDiffLayoutWithoutLegacyStretchBehaviour &&
3625
+ node->didUseLegacyFlag ()) {
3624
3626
const YGNodeRef originalNode = YGNodeDeepClone (node);
3625
3627
originalNode->resolveDimension ();
3626
3628
// Recursively mark nodes as dirty
You can’t perform that action at this time.
0 commit comments