From 23e2610f4fcebbdad3ee8f0e18baa83c8bef624b Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 15 Dec 2016 08:49:51 -0800 Subject: [PATCH] Add YGNodeGetParent api Reviewed By: gkassabli Differential Revision: D4333456 fbshipit-source-id: 388afd0a01c19a6db73c175bf24c566278832cb9 --- ReactCommon/yoga/yoga/Yoga.c | 4 ++++ ReactCommon/yoga/yoga/Yoga.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ReactCommon/yoga/yoga/Yoga.c b/ReactCommon/yoga/yoga/Yoga.c index 29acb4599a617f..6340d021ce1c79 100644 --- a/ReactCommon/yoga/yoga/Yoga.c +++ b/ReactCommon/yoga/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/ReactCommon/yoga/yoga/Yoga.h b/ReactCommon/yoga/yoga/Yoga.h index c7bc600df7b467..79c59a4bf6637a 100644 --- a/ReactCommon/yoga/yoga/Yoga.h +++ b/ReactCommon/yoga/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,