Skip to content

Commit 2b08f10

Browse files
authored
fix: fix the issue that rotation control jumps during orientation change (#433)
1 parent 336d380 commit 2b08f10

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/Mantis/CropView/CropView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ final class CropView: UIView {
300300
rotationControlView.frame.origin.x = cropAuxiliaryIndicatorView.frame.origin.x +
301301
(cropAuxiliaryIndicatorView.frame.width - rotationControlView.frame.width) / 2
302302
rotationControlView.frame.origin.y = cropAuxiliaryIndicatorView.frame.maxY
303-
} else if Orientation.isLandscapeLeft {
303+
} else if Orientation.isLandscapeRight {
304304
rotationControlView.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2)
305305
rotationControlView.frame.origin.x = cropAuxiliaryIndicatorView.frame.maxX
306306
rotationControlView.frame.origin.y = cropAuxiliaryIndicatorView.frame.origin.y +
307307
(cropAuxiliaryIndicatorView.frame.height - rotationControlView.frame.height) / 2
308-
} else if Orientation.isLandscapeRight {
308+
} else if Orientation.isLandscapeLeft {
309309
rotationControlView.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
310310
rotationControlView.frame.origin.x = cropAuxiliaryIndicatorView.frame.minX - rotationControlView.frame.width
311311
rotationControlView.frame.origin.y = cropAuxiliaryIndicatorView.frame.origin.y +
@@ -483,7 +483,7 @@ extension CropView {
483483
contentRect.size.height = rect.height - 2 * cropViewPadding
484484

485485
contentRect.origin.y = rect.origin.y + cropViewPadding
486-
if Orientation.isLandscapeLeft {
486+
if Orientation.isLandscapeRight {
487487
contentRect.origin.x = rect.origin.x + cropViewPadding
488488
} else {
489489
contentRect.origin.x = rect.origin.x + cropViewPadding + rotationControlViewHeight

Sources/Mantis/RotationDial/SlideDial/SlideDial.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ final class SlideDial: UIView, RotationControlViewProtocol {
9595

9696
if Orientation.treatAsPortrait {
9797
indicator.transform = CGAffineTransform(rotationAngle: 0)
98-
} else if Orientation.isLandscapeLeft {
99-
indicator.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
10098
} else if Orientation.isLandscapeRight {
99+
indicator.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
100+
} else if Orientation.isLandscapeLeft {
101101
indicator.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2)
102102
}
103103
}

0 commit comments

Comments
 (0)