Skip to content

Commit

Permalink
Implement rowGap, columnGap and gap flex properties (microsoft#10969)
Browse files Browse the repository at this point in the history
* Implement rowGap, columnGap and gap flex properties

* Change files
  • Loading branch information
acoates-ms authored and chrisglein committed Feb 8, 2023
1 parent cd24ccc commit d7a8d6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Implement rowGap, columnGap and gap flex properties",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
9 changes: 9 additions & 0 deletions vnext/Microsoft.ReactNative/Modules/NativeUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,15 @@ static void StyleYogaNode(
YGValue result = YGValueOrDefault(value, YGValue{YGUndefined, YGUnitPoint} /*default*/, shadowNode, key);

SetYogaUnitValueHelper(yogaNode, result, YGNodeStyleSetMaxHeight, YGNodeStyleSetMaxHeightPercent);
} else if (key == "rowGap") {
float result = NumberOrDefault(value, 0.0f /*default*/);
YGNodeStyleSetGap(yogaNode, YGGutterRow, result);
} else if (key == "columnGap") {
float result = NumberOrDefault(value, 0.0f /*default*/);
YGNodeStyleSetGap(yogaNode, YGGutterColumn, result);
} else if (key == "gap") {
float result = NumberOrDefault(value, 0.0f /*default*/);
YGNodeStyleSetGap(yogaNode, YGGutterAll, result);
} else if (key == "margin") {
YGValue result = YGValueOrDefault(value, YGValue{YGUndefined, YGUnitPoint} /*default*/, shadowNode, key);

Expand Down

0 comments on commit d7a8d6e

Please sign in to comment.