From 010cdcdc19c3fc3ed16c7b63b163b3b62ff0ea38 Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Tue, 6 Sep 2022 06:48:30 -0700 Subject: [PATCH] Add `setMargin` accepting `Dimension` Summary: Changelog: [Internal][Added] - Add `setMargin` accepting `Dimension` in Yoga 2 Reviewed By: Andrey-Mishanin Differential Revision: D39271039 fbshipit-source-id: ff98b23352377b16d353cd6922ee37e48c80e55b --- ReactCommon/flexlayout/flexlayout/FlexItemStyle.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/flexlayout/flexlayout/FlexItemStyle.h b/ReactCommon/flexlayout/flexlayout/FlexItemStyle.h index 1627b69bdf7..1a7068e6025 100644 --- a/ReactCommon/flexlayout/flexlayout/FlexItemStyle.h +++ b/ReactCommon/flexlayout/flexlayout/FlexItemStyle.h @@ -132,6 +132,10 @@ class FLEX_LAYOUT_EXPORT FlexItemStyleBase { return margin[static_cast(edge)]; } + void setMargin(Edge edge, Dimension dimension) { + margin[static_cast(edge)] = dimension; + } + void setMargin(Edge edge, Float value) { margin[static_cast(edge)] = Dimension(value, Unit::Point); }