Skip to content

Rotation bound check fails #45

Description

@nissaba

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions