Skip to content

Commit 9d8e52b

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Serialize TransformOrigin to folly::dynamic (#45396)
Summary: Pull Request resolved: #45396 This diff extends TransformOrigin with a new method to serialize this Struct into a folly::dynamic map (similar to Transform) changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D59613247 fbshipit-source-id: 00e4a08d1a99fe9cabb67206e21712e65b355f7f
1 parent 9df4239 commit 9d8e52b

File tree

1 file changed

+11
-0
lines changed
  • packages/react-native/ReactCommon/react/renderer/graphics

1 file changed

+11
-0
lines changed

packages/react-native/ReactCommon/react/renderer/graphics/Transform.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ struct TransformOrigin {
6767
return xy[0].value != 0.0f || xy[0].unit != UnitType::Undefined ||
6868
xy[1].value != 0.0f || xy[1].unit != UnitType::Undefined || z != 0.0f;
6969
}
70+
71+
#ifdef ANDROID
72+
73+
/**
74+
* Convert to folly::dynamic.
75+
*/
76+
operator folly::dynamic() const {
77+
return folly::dynamic::array(xy[0].value, xy[1].value, z);
78+
}
79+
80+
#endif
7081
};
7182

7283
/*

0 commit comments

Comments
 (0)