CGAffineTransformInvert: singular matrix

非 Y 不嫁゛ 提交于 2019-11-29 10:25:27

From looking around at other posts, it appears you'll get this message if you try and set the zoom scale to zero. Would be useful to NSLog the scale value when you pinch and see if it gets to zero (and occurs at the same time as the affine transform error).

Try using a real near zero value then :

#define kNearZeroValue 0.001f

This is the problem with affine transformations when transforming matrix somewhere in the code.

So basically the code is trying to transform a singular matrix (determinant is 0) which is invalid. So you should avoid matrices like:

0 0 0
0 0 0
0 0 1

and similar by checking whether it's singular 3x3 matrix based on its determinant. It is considered a mathematical violation to perform operations on matrices with a determinant of zero (similar to dividing by zero).

If you're using class, make sure you aren't scaling instance to 0 either using setZoomScale:animated: method or zoomScale property, so please check your scroll views (set your zoomScale, minimumZoomScale and maximumZoomScale to set to at least 0.1).

Source: CGAffineTransformInvert - singular matrix error

Terminus

For each webView do:

webView.scrollView.minimumZoomScale = 0.1;

Or any other number greater than zero.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!