diff --git a/yoga/Yoga.c b/yoga/Yoga.c index 29acb459..6340d021 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -333,6 +333,10 @@ YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index) { return YGNodeListGet(node->children, index); } +YGNodeRef YGNodeGetParent(const YGNodeRef node) { + return node->parent; +} + inline uint32_t YGNodeChildCount(const YGNodeRef node) { return YGNodeListCount(node->children); } diff --git a/yoga/Yoga.h b/yoga/Yoga.h index c7bc600d..79c59a4b 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -64,6 +64,7 @@ WIN_EXPORT void YGNodeInsertChild(const YGNodeRef node, const uint32_t index); WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child); WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index); +WIN_EXPORT YGNodeRef YGNodeGetParent(const YGNodeRef node); WIN_EXPORT uint32_t YGNodeChildCount(const YGNodeRef node); WIN_EXPORT void YGNodeCalculateLayout(const YGNodeRef node,