Skip to content

Commit

Permalink
fix: fix wrong image container rect values after rotating (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed Jul 13, 2023
1 parent 0dd5773 commit a4c5013
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Mantis/CropView/CropView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ class CropView: UIView {
return
}

let imageContainerRect = imageContainer.convert(imageContainer.bounds, to: self)
let imageFrame = CGRect(x: cropWorkbenchView.frame.origin.x - cropWorkbenchView.contentOffset.x,
y: cropWorkbenchView.frame.origin.y - cropWorkbenchView.contentOffset.y,
width: imageContainer.frame.width,
height: imageContainer.frame.height)
width: imageContainerRect.size.width,
height: imageContainerRect.size.height)

guard imageFrame.contains(touchPoint) else {
return
Expand Down

0 comments on commit a4c5013

Please sign in to comment.