Open nissaba opened 8 years ago
Hello I am trying to set a method to di a 90degree left or right rotation. this as a side effect that the bound checking becomes invalid.
Not sure if I not setting some this I should or should not.
But this is my code below that I added to the HFImageEditorViewController
(void) rotate:(ImageRotationDirection)pOrientation { CGFloat rotation = 0; if (pOrientation == ImageRotationDirectionRight) { rotation = M_PI_2; } else { rotation = -M_PI_2; }
CGAffineTransform transform = CGAffineTransformRotate(self.imageView.transform, rotation); CGRect rectA = self.imageView.frame; rectA = CGRectApplyAffineTransform(rectA, transform); CGFloat scale = self.cropRect.size.width/rectA.size.width; transform = CGAffineTransformScale(transform, scale/self.scale, scale/self.scale); [self checkBoundsWithTransform:transform]; self.imageView.transform = self.validTransform; }
Hello I am trying to set a method to di a 90degree left or right rotation. this as a side effect that the bound checking becomes invalid.
Not sure if I not setting some this I should or should not.
But this is my code below that I added to the HFImageEditorViewController
(void) rotate:(ImageRotationDirection)pOrientation { CGFloat rotation = 0; if (pOrientation == ImageRotationDirectionRight) { rotation = M_PI_2; } else { rotation = -M_PI_2; }
CGAffineTransform transform = CGAffineTransformRotate(self.imageView.transform, rotation); CGRect rectA = self.imageView.frame; rectA = CGRectApplyAffineTransform(rectA, transform); CGFloat scale = self.cropRect.size.width/rectA.size.width; transform = CGAffineTransformScale(transform, scale/self.scale, scale/self.scale); [self checkBoundsWithTransform:transform]; self.imageView.transform = self.validTransform; }