mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Fabric: EdgeInsets
from dynamic
conversion
Summary: We will need this for several components, first of all for ScrollView. Reviewed By: fkgozali Differential Revision: D7958246 fbshipit-source-id: 364b939abe8f0734376448149bbdc735abd00189
This commit is contained in:
parent
545f087b46
commit
30d08ea8a4
@ -75,6 +75,19 @@ inline void fromDynamic(const folly::dynamic &value, Size &result) {
|
||||
abort();
|
||||
}
|
||||
|
||||
inline void fromDynamic(const folly::dynamic &value, EdgeInsets &result) {
|
||||
if (value.isArray()) {
|
||||
result = EdgeInsets {
|
||||
(Float)value[0].asDouble(),
|
||||
(Float)value[1].asDouble(),
|
||||
(Float)value[2].asDouble(),
|
||||
(Float)value[3].asDouble()
|
||||
};
|
||||
return;
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
inline std::string toString(const Point &point) {
|
||||
return "{" + folly::to<std::string>(point.x) + ", " + folly::to<std::string>(point.y) + "}";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user