Add layout direction documentation (#1599)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1599 tsia. Had to add JS api support for set/get direction Reviewed By: yungsters Differential Revision: D54778992 fbshipit-source-id: 346152e1d61c80aa524b515e8b30a96fe32fe7c3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
aed6f015bf
commit
bd3e3edc75
@@ -104,6 +104,10 @@ void Node::setFlexDirection(int flexDirection) {
|
||||
m_node, static_cast<YGFlexDirection>(flexDirection));
|
||||
}
|
||||
|
||||
void Node::setDirection(int direction) {
|
||||
YGNodeStyleSetDirection(m_node, static_cast<YGDirection>(direction));
|
||||
}
|
||||
|
||||
void Node::setFlexWrap(int flexWrap) {
|
||||
YGNodeStyleSetFlexWrap(m_node, static_cast<YGWrap>(flexWrap));
|
||||
}
|
||||
@@ -261,6 +265,10 @@ int Node::getFlexDirection(void) const {
|
||||
return YGNodeStyleGetFlexDirection(m_node);
|
||||
}
|
||||
|
||||
int Node::getDirection(void) const {
|
||||
return YGNodeStyleGetDirection(m_node);
|
||||
}
|
||||
|
||||
int Node::getFlexWrap(void) const {
|
||||
return YGNodeStyleGetFlexWrap(m_node);
|
||||
}
|
||||
|
@@ -83,6 +83,7 @@ class Node {
|
||||
void setFlexDirection(int flexDirection);
|
||||
void setFlexWrap(int flexWrap);
|
||||
void setJustifyContent(int justifyContent);
|
||||
void setDirection(int direction);
|
||||
|
||||
void setMargin(int edge, double margin);
|
||||
void setMarginPercent(int edge, double margin);
|
||||
@@ -134,6 +135,7 @@ class Node {
|
||||
int getFlexDirection(void) const;
|
||||
int getFlexWrap(void) const;
|
||||
int getJustifyContent(void) const;
|
||||
int getDirection(void) const;
|
||||
|
||||
Value getMargin(int edge) const;
|
||||
|
||||
|
@@ -117,6 +117,8 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
||||
.function("setPaddingPercent", &Node::setPaddingPercent)
|
||||
.function("setGap", &Node::setGap)
|
||||
|
||||
.function("setDirection", &Node::setDirection)
|
||||
|
||||
.function("getPositionType", &Node::getPositionType)
|
||||
.function("getPosition", &Node::getPosition)
|
||||
|
||||
@@ -190,5 +192,7 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
||||
|
||||
.function("getComputedMargin", &Node::getComputedMargin)
|
||||
.function("getComputedBorder", &Node::getComputedBorder)
|
||||
.function("getComputedPadding", &Node::getComputedPadding);
|
||||
.function("getComputedPadding", &Node::getComputedPadding)
|
||||
|
||||
.function("getDirection", &Node::getDirection);
|
||||
}
|
||||
|
@@ -95,6 +95,7 @@ export type Node = {
|
||||
getComputedRight(): number;
|
||||
getComputedTop(): number;
|
||||
getComputedWidth(): number;
|
||||
getDirection(): Direction;
|
||||
getDisplay(): Display;
|
||||
getFlexBasis(): Value;
|
||||
getFlexDirection(): FlexDirection;
|
||||
@@ -126,6 +127,7 @@ export type Node = {
|
||||
setAlignSelf(alignSelf: Align): void;
|
||||
setAspectRatio(aspectRatio: number | undefined): void;
|
||||
setBorder(edge: Edge, borderWidth: number | undefined): void;
|
||||
setDirection(direction: Direction): void;
|
||||
setDisplay(display: Display): void;
|
||||
setFlex(flex: number | undefined): void;
|
||||
setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;
|
||||
|
Reference in New Issue
Block a user