mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 16:10:58 +00:00
Fabric: Implementation of <View transform={...}/> property
Summary: After moving all matrix math to C++, the actual client native code is quite trivial. Reviewed By: fkgozali Differential Revision: D8344059 fbshipit-source-id: 6910c6af5de64d5f901e82075d30edbde177af40
This commit is contained in:
parent
55f8cfe693
commit
dc0ebf7cb0
@ -110,6 +110,10 @@ using namespace facebook::react;
|
|||||||
self.userInteractionEnabled = newViewProps.pointerEvents != PointerEventsMode::None;
|
self.userInteractionEnabled = newViewProps.pointerEvents != PointerEventsMode::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// `transform`
|
||||||
|
if (oldViewProps.transform != newViewProps.transform) {
|
||||||
|
self.layer.transform = RCTCATransform3DFromTransformMatrix(newViewProps.transform);
|
||||||
|
self.layer.allowsEdgeAntialiasing = newViewProps.transform != Transform::Identity();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement all sutable non-layout <View> props.
|
// TODO: Implement all sutable non-layout <View> props.
|
||||||
|
@ -35,6 +35,28 @@ inline UIEdgeInsets RCTUIEdgeInsetsFromEdgeInsets(facebook::react::EdgeInsets ed
|
|||||||
return {edgeInsets.top, edgeInsets.left, edgeInsets.bottom, edgeInsets.right};
|
return {edgeInsets.top, edgeInsets.left, edgeInsets.bottom, edgeInsets.right};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline CATransform3D RCTCATransform3DFromTransformMatrix(facebook::react::Transform transformMatrix) {
|
||||||
|
return {
|
||||||
|
(CGFloat)transformMatrix.matrix[0],
|
||||||
|
(CGFloat)transformMatrix.matrix[1],
|
||||||
|
(CGFloat)transformMatrix.matrix[2],
|
||||||
|
(CGFloat)transformMatrix.matrix[3],
|
||||||
|
(CGFloat)transformMatrix.matrix[4],
|
||||||
|
(CGFloat)transformMatrix.matrix[5],
|
||||||
|
(CGFloat)transformMatrix.matrix[6],
|
||||||
|
(CGFloat)transformMatrix.matrix[7],
|
||||||
|
(CGFloat)transformMatrix.matrix[8],
|
||||||
|
(CGFloat)transformMatrix.matrix[9],
|
||||||
|
(CGFloat)transformMatrix.matrix[10],
|
||||||
|
(CGFloat)transformMatrix.matrix[11],
|
||||||
|
(CGFloat)transformMatrix.matrix[12],
|
||||||
|
(CGFloat)transformMatrix.matrix[13],
|
||||||
|
(CGFloat)transformMatrix.matrix[14],
|
||||||
|
(CGFloat)transformMatrix.matrix[15]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
inline facebook::react::Point RCTPointFromCGPoint(CGPoint point) {
|
inline facebook::react::Point RCTPointFromCGPoint(CGPoint point) {
|
||||||
return {point.x, point.y};
|
return {point.x, point.y};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user