Revert D48712710: C++ Cleanup 3/N: Reorganize YGNode

Differential Revision:
D48712710

Original commit changeset: d28eae38469a

Original Phabricator Diff: D48712710

fbshipit-source-id: 7a10b071edcf045ce98bbf8f9deca0d0e2e80a14
This commit is contained in:
Zhiyao Zhou
2023-08-29 23:27:25 -07:00
committed by Facebook GitHub Bot
parent 6ca56e87ce
commit ea7f61a3db
31 changed files with 578 additions and 625 deletions

View File

@@ -6,13 +6,14 @@
*/
#include <gtest/gtest.h>
#include <yoga/YGNode.h>
#include <yoga/Yoga.h>
static float _baseline(
YGNodeRef node,
const float /*width*/,
const float /*height*/) {
float* baseline = (float*) YGNodeGetContext(node);
float* baseline = (float*) node->getContext();
return *baseline;
}
@@ -35,9 +36,9 @@ TEST(YogaTest, align_baseline_customer_func) {
float baselineValue = 10;
const YGNodeRef root_child1_child0 = YGNodeNew();
YGNodeSetContext(root_child1_child0, &baselineValue);
root_child1_child0->setContext(&baselineValue);
YGNodeStyleSetWidth(root_child1_child0, 50);
YGNodeSetBaselineFunc(root_child1_child0, _baseline);
root_child1_child0->setBaselineFunc(_baseline);
YGNodeStyleSetHeight(root_child1_child0, 20);
YGNodeInsertChild(root_child1, root_child1_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);