Skip to content

Commit

Permalink
fix: fixe a crop issue after rotation for alwaysUsingOnePresetFixedRatio
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingtao Guo authored and Yingtao Guo committed Apr 23, 2021
1 parent de03623 commit f8f7763
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Mantis/CropView/CropView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ extension CropView {

let newCropBounds = CGRect(x: 0, y: 0, width: viewModel.cropBoxFrame.width * scale, height: viewModel.cropBoxFrame.height * scale)

let radians = viewModel.getTotalRadians()
let radians = forceFixedRatio ? viewModel.radians : viewModel.getTotalRadians()

// calculate the new bounds of scroll view
let newBoundWidth = abs(cos(radians)) * newCropBounds.size.width + abs(sin(radians)) * newCropBounds.size.height
Expand Down

0 comments on commit f8f7763

Please sign in to comment.