Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发可以缩放、旋转和翻译图像的应用程序。我在旋转撤消时保存角度。同样,我将 centerX 和 centerY 保存为翻译撤消。但是保存缩放参数会导致不希望的结果。请告诉我如何撤消缩放的图像。谢谢
-(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; }