Node -> Measure func map instead of vec (#1581)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1581

This is better than just trusting the order of the measure func call. Now each measure function I/O is associated with a node in the JSON.

Reviewed By: NickGerleman

Differential Revision: D53776790

fbshipit-source-id: 793cf2d9cbf6f663d24848af0af30aa297614eea
This commit is contained in:
Joe Vilches
2024-02-21 18:02:58 -08:00
committed by Facebook GitHub Bot
parent b35456b93c
commit c278713eb5
9 changed files with 10165 additions and 9807 deletions

View File

@@ -25,7 +25,11 @@ enum class PrintOptions : uint8_t {
};
YG_DEFINE_ENUM_FLAG_OPERATORS(PrintOptions);
void serializeTree(nlohmann::json& j, YGNodeRef root, PrintOptions options);
void serializeTree(
nlohmann::json& j,
SerializedMeasureFuncMap& nodesToMeasureFuncs,
YGNodeRef root,
PrintOptions options);
void serializeLayoutInputs(
nlohmann::json& j,
@@ -33,8 +37,4 @@ void serializeLayoutInputs(
float availableHeight,
YGDirection ownerDirection);
void serializeMeasureFuncResults(
nlohmann::json& j,
std::vector<SerializedMeasureFunc>& measureFuncs);
} // namespace facebook::yoga