Add JavaScript bindings for YGHasNewLayout (#1631)

Summary:
Adds JavaScript bindings for YGHasNewLayout which introduces
two new node methods: `hasNewLayout()` and `markLayoutSeen()`.

Closes https://github.com/facebook/yoga/issues/681

Pull Request resolved: https://github.com/facebook/yoga/pull/1631

Reviewed By: joevilches

Differential Revision: D55213296

Pulled By: NickGerleman

fbshipit-source-id: 161288c3f54c2b82a6b2b842387916fe8713c2c9
This commit is contained in:
Willson Haw
2024-03-21 17:36:36 -07:00
committed by Facebook GitHub Bot
parent 9dcd8ba9dc
commit 5cbc7b4f1c
6 changed files with 111 additions and 3 deletions

View File

@@ -421,6 +421,14 @@ bool Node::isDirty(void) const {
return YGNodeIsDirty(m_node);
}
void Node::markLayoutSeen() {
YGNodeSetHasNewLayout(m_node, false);
}
bool Node::hasNewLayout(void) const {
return YGNodeGetHasNewLayout(m_node);
}
void Node::calculateLayout(double width, double height, int direction) {
YGNodeCalculateLayout(
m_node, width, height, static_cast<YGDirection>(direction));