Fix skew transform on native side (iOS & Android)
Summary: According to #11992 fix skew transform in native code as well janicduplessis vjeux Closes https://github.com/facebook/react-native/pull/12106 Differential Revision: D4479880 fbshipit-source-id: d84780842b555f6352d84d229b5b6c5c3c6a0647
This commit is contained in:
parent
850c71c2f3
commit
c68195929b
|
@ -118,13 +118,11 @@ static const NSUInteger kMatrixArrayLength = 4 * 4;
|
|||
|
||||
} else if ([property isEqualToString:@"skewX"]) {
|
||||
CGFloat skew = [self convertToRadians:value];
|
||||
transform.m21 = sinf(skew);
|
||||
transform.m22 = cosf(skew);
|
||||
transform.m21 = tanf(skew);
|
||||
|
||||
} else if ([property isEqualToString:@"skewY"]) {
|
||||
CGFloat skew = [self convertToRadians:value];
|
||||
transform.m11 = cosf(skew);
|
||||
transform.m12 = sinf(skew);
|
||||
transform.m12 = tanf(skew);
|
||||
|
||||
} else {
|
||||
RCTLogError(@"Unsupported transform type for a CATransform3D: %@.", property);
|
||||
|
|
|
@ -426,13 +426,11 @@ public class MatrixMathHelper {
|
|||
}
|
||||
|
||||
public static void applySkewX(double[] m, double radians) {
|
||||
m[4] = Math.sin(radians);
|
||||
m[5] = Math.cos(radians);
|
||||
m[4] = Math.tan(radians);
|
||||
}
|
||||
|
||||
public static void applySkewY(double[] m, double radians) {
|
||||
m[0] = Math.cos(radians);
|
||||
m[1] = Math.sin(radians);
|
||||
m[1] = Math.tan(radians);
|
||||
}
|
||||
|
||||
public static void applyRotateX(double[] m, double radians) {
|
||||
|
|
Loading…
Reference in New Issue