Skip to content

Commit

Permalink
Add setMargin accepting Dimension
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Internal][Added] - Add `setMargin` accepting `Dimension` in Yoga 2

Reviewed By: Andrey-Mishanin

Differential Revision: D39271039

fbshipit-source-id: ff98b23352377b16d353cd6922ee37e48c80e55b
  • Loading branch information
Fabrizio Cucci authored and facebook-github-bot committed Sep 6, 2022
1 parent 65db77d commit 010cdcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ReactCommon/flexlayout/flexlayout/FlexItemStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class FLEX_LAYOUT_EXPORT FlexItemStyleBase {
return margin[static_cast<size_t>(edge)];
}

void setMargin(Edge edge, Dimension dimension) {
margin[static_cast<size_t>(edge)] = dimension;
}

void setMargin(Edge edge, Float value) {
margin[static_cast<size_t>(edge)] = Dimension(value, Unit::Point);
}
Expand Down

0 comments on commit 010cdcd

Please sign in to comment.