Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation bound check fails #45

Open
nissaba opened this issue Jan 7, 2016 · 0 comments
Open

Rotation bound check fails #45

nissaba opened this issue Jan 7, 2016 · 0 comments

Comments

@nissaba
Copy link

nissaba commented Jan 7, 2016

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;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant