Add YGLayoutGetMargin, counterpart of YGLayoutGetPadding

This commit is contained in:
Maël Nison
2017-01-12 10:46:36 +01:00
parent c4a3e12add
commit f033c835e5
9 changed files with 164 additions and 29 deletions

View File

@@ -453,3 +453,13 @@ Layout Node::getComputedLayout(void) const
return layout;
}
double Node::getComputedMargin(int edge) const
{
return YGNodeLayoutGetMargin(m_node, static_cast<YGEdge>(edge));
}
double Node::getComputedPadding(int edge) const
{
return YGNodeLayoutGetPadding(m_node, static_cast<YGEdge>(edge));
}

View File

@@ -176,6 +176,9 @@ class Node {
Layout getComputedLayout(void) const;
double getComputedMargin(int edge) const;
double getComputedPadding(int edge) const;
private:
YGNodeRef m_node;

View File

@@ -153,4 +153,7 @@ NBIND_CLASS(Node)
method(getComputedHeight);
method(getComputedLayout);
method(getComputedMargin);
method(getComputedPadding);
}