Add back deprecated getParent methods for non-breaking API change #775

Closed
vinc3m1 wants to merge 1 commits from getparent into master
5 changed files with 13 additions and 3 deletions

View File

@@ -234,15 +234,14 @@ public class YogaNode implements Cloneable {
* {@link YogaNode} is shared between two or more YogaTrees. * {@link YogaNode} is shared between two or more YogaTrees.
*/ */
@Nullable @Nullable
public public YogaNode getOwner() {
YogaNode getOwner() {
return mOwner; return mOwner;
} }
/** @deprecated Use #getOwner() instead. This will be removed in the next version. */ /** @deprecated Use #getOwner() instead. This will be removed in the next version. */
@Deprecated @Deprecated
@Nullable @Nullable
YogaNode getParent() { public YogaNode getParent() {
return getOwner(); return getOwner();
} }

View File

@@ -53,6 +53,10 @@ YGNodeRef YGNode::getOwner() const {
return owner_; return owner_;
} }
YGNodeRef YGNode::getParent() const {
return getOwner();
}
YGVector YGNode::getChildren() const { YGVector YGNode::getChildren() const {
return children_; return children_;
} }

View File

@@ -78,6 +78,8 @@ struct YGNode {
// to one YogaTree or nullptr when the YGNode is shared between two or more // to one YogaTree or nullptr when the YGNode is shared between two or more
// YogaTrees. // YogaTrees.
YGNodeRef getOwner() const; YGNodeRef getOwner() const;
// Deprecated, use getOwner() instead.
YGNodeRef getParent() const;
YGVector getChildren() const; YGVector getChildren() const;
uint32_t getChildrenCount() const; uint32_t getChildrenCount() const;
YGNodeRef getChild(uint32_t index) const; YGNodeRef getChild(uint32_t index) const;

View File

@@ -535,6 +535,10 @@ YGNodeRef YGNodeGetOwner(const YGNodeRef node) {
return node->getOwner(); return node->getOwner();
} }
YGNodeRef YGNodeGetParent(const YGNodeRef node) {
return node->getOwner();
}
void YGNodeMarkDirty(const YGNodeRef node) { void YGNodeMarkDirty(const YGNodeRef node) {
YGAssertWithNode( YGAssertWithNode(
node, node,

View File

@@ -92,6 +92,7 @@ WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);
WIN_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef node); WIN_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef node);
WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index); WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);
WIN_EXPORT YGNodeRef YGNodeGetOwner(const YGNodeRef node); WIN_EXPORT YGNodeRef YGNodeGetOwner(const YGNodeRef node);
WIN_EXPORT YGNodeRef YGNodeGetParent(const YGNodeRef node);
WIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node); WIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node);
WIN_EXPORT void YGNodeSetChildren( WIN_EXPORT void YGNodeSetChildren(
YGNodeRef const owner, YGNodeRef const owner,