0 votes
asked in xCode by (2.3k points)

Im working on application in which i scale ,rotate and translate image. Im saving angle while rotating for undo. Similarly im saving centerX and centerY for translation undo. But saving scaling parameter results into undesired results. Please tell me how to undo scaled image. Thanks

1 Answer

0 votes
answered by (4.2k points)
-(CGFloat)getCurrentScale {
    CGAffineTransform t = image.transform;
    CGFloat a, c, b, d;
    a = t.a;
    c = t.c;
    b = t.b;
    d = t.d;
    CGFloat scaleX = sqrt(powf(a,2)+powf(c,2));
    return scaleX;