Skip to content

Commit 009eaf8

Browse files
Merge branch 'master' into f/fix-svg-viewbox
2 parents 70fac63 + d553ef6 commit 009eaf8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/utils/processTransform/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ function isRotation(a: number, b: number, c: number, d: number) {
1212

1313
const rad2deg = 180 / Math.PI;
1414

15-
function getRotation(a, b) {
15+
function getRotation(a: number, b: number) {
16+
const sketchFactor = -1;
1617
const possibleRotation = Math.acos(a);
1718
if (closeEnough(Math.sin(possibleRotation), b) || closeEnough(Math.sin(possibleRotation), -b)) {
18-
return possibleRotation * rad2deg;
19+
return sketchFactor * possibleRotation * rad2deg;
1920
}
20-
return (possibleRotation + Math.PI) * rad2deg;
21+
return sketchFactor * (possibleRotation + Math.PI) * rad2deg;
2122
}
2223

23-
export default function(layout: LayoutInfo, props: ViewStyle) {
24+
export default function(
25+
layout: LayoutInfo,
26+
props: ViewStyle,
27+
): { rotation?: number; isFlippedVertical?: boolean; isFlippedHorizontal?: boolean } {
2428
if (!props.transform) {
2529
return {};
2630
}

0 commit comments

Comments
 (0)