Expose layout diffing flag to java

Summary:
This diff exposes `shouldDiffLayoutWithoutLegacyStretchBehaviour` from YGConfig and `doesLegacyStretchFlagAffectsLayout` from YGLayout to YogaConfig and YogaNode respectively

Also added a positive test case. Didn't find the negative test case example. @[508947467:ianc] or @[759512522:emilsj], can you suggest a negative test case example.

Reviewed By: emilsjolander

Differential Revision: D7272067

fbshipit-source-id: e67e82eb057e4c7124904c715f9dca4dcfea21ea
This commit is contained in:
Pritesh Nandgaonkar
2018-03-14 08:37:55 -07:00
committed by Facebook Github Bot
parent d567885070
commit 3dfb68887d
6 changed files with 93 additions and 16 deletions

View File

@@ -905,6 +905,10 @@ YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Margin, margin);
YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Border, border);
YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Padding, padding);
bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout(const YGNodeRef node) {
return node->getLayout().doesLegacyStretchFlagAffectsLayout;
}
uint32_t gCurrentGenerationCount = 0;
bool YGLayoutNodeInternal(const YGNodeRef node,
@@ -3842,6 +3846,12 @@ void YGConfigSetLogger(const YGConfigRef config, YGLogger logger) {
}
}
void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour(
const YGConfigRef config,
const bool shouldDiffLayout) {
config->shouldDiffLayoutWithoutLegacyStretchBehaviour = shouldDiffLayout;
}
static void YGVLog(const YGConfigRef config,
const YGNodeRef node,
YGLogLevel level,