Replies: 2 comments
-
@rickshane public typealias CropInfo = (
translation: CGPoint,
rotation: CGFloat,
scaleX: CGFloat,
scaleY: CGFloat,
cropSize: CGSize,
imageViewSize: CGSize,
cropRegion: CropRegion
) Just want to know if the cropRect size you mentioned is the cropped image size? If so, you can use |
Beta Was this translation helpful? Give feedback.
0 replies
-
I solved it. I was not multiplying the sides by the scaled image width and height before squaring and calculating the hypotenuse. The correct equations are:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using CropRegion in my test harness to perform relative crops of images at different zoomScales. This is useful when an image has been scaled up or down before applying the crop. However, when I fully rotate an image to 45 degrees, I cannot seem to properly calculate the crop width and height based on the CropRegion data.
I don't see CropRegion being used in Mantis. I was hoping to compare my results with the Mantis test harness. Did this logic get deprecated at some point? It is a very useful data structure.
I use the following logic to calculate the crop width and height of a rotated image using cropRegion:
Or is there a better mechanism to crop an image that has first been scaled?
Thanks,
Rick
Beta Was this translation helpful? Give feedback.
All reactions