Skip to content

Commit

Permalink
JS bindings for setAlwaysFormsContainingBlock (#1541)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1541

tsia

Reviewed By: NickGerleman

Differential Revision: D52608426

fbshipit-source-id: 19fa01d87cbae3457adb9cdb9e0cb602b7afa619
  • Loading branch information
joevilches authored and facebook-github-bot committed Jan 9, 2024
1 parent 47e9f33 commit e4ab593
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions javascript/src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,7 @@ double Node::getComputedBorder(int edge) const {
double Node::getComputedPadding(int edge) const {
return YGNodeLayoutGetPadding(m_node, static_cast<YGEdge>(edge));
}

void Node::setAlwaysFormsContainingBlock(bool alwaysFormsContainingBlock) {
return YGNodeSetAlwaysFormContainingBlock(m_node, alwaysFormsContainingBlock);
}
3 changes: 3 additions & 0 deletions javascript/src/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,7 @@ class Node {

std::unique_ptr<MeasureCallback> m_measureFunc;
std::unique_ptr<DirtiedCallback> m_dirtiedFunc;

public:
void setAlwaysFormsContainingBlock(bool alwaysFormContainingBlock);
};
3 changes: 3 additions & 0 deletions javascript/src/embind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
.function("getParent", &Node::getParent, allow_raw_pointers())
.function("getChild", &Node::getChild, allow_raw_pointers())

.function(
"setAlwaysFormsContainingBlock", &Node::setAlwaysFormsContainingBlock)

.function("isReferenceBaseline", &Node::isReferenceBaseline)
.function("setIsReferenceBaseline", &Node::setIsReferenceBaseline)

Expand Down
1 change: 1 addition & 0 deletions javascript/src/wrapAssembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export type Node = {
setWidthPercent(width: number | undefined): void;
unsetDirtiedFunc(): void;
unsetMeasureFunc(): void;
setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
};

export type Yoga = {
Expand Down

0 comments on commit e4ab593

Please sign in to comment.