Valentin Shergin 64c327ae68 Fixed issue where setting zero scale transfrom matrix to UIView brokes hitTest mechanism
Summary:
The Math Strikes Back

Several related things:
 * When we specify `scale: 0;` style for some view it ends up with calling `CATransform3DScale` with zero scale parameter.
 * In this case `CATransform3DScale` returns transform matrix full of zeros. It actually depends on representation and matrix-type (2d or 3d) but in UIView debugger it appears as [0, 0, 0, 0, ...]. And probably it is correct result.
 * By default, for hit-testing, UIKit uses specially optimized logic based on GPU/CALayer infrastructure under the hood. And the transform matrix full of zeros breaks this algorithm. I guess, it happens because zero-matrix doesn't quite make sense.

So, `scale: 0;` is a weird edge case, and in this diff, we are trying to illuminate it by replacing with epsilon value.

Related SO issues:
http://stackoverflow.com/questions/25964224/cgaffinetransformscale-not-working-with-zero-scale
http://stackoverflow.com/questions/7937369/animate-uiview-scale-to-zero

Reviewed By: blairvanderhoof

Differential Revision: D4734475

fbshipit-source-id: 7241cdffa86c05a6552860a25789e2281588ba23
2017-03-19 22:01:55 -07:00
..
2016-01-07 12:03:17 -08:00
2016-08-10 13:13:34 -07:00
2016-11-18 14:43:31 -08:00
2016-09-08 17:58:50 -07:00
2017-03-14 17:46:24 -07:00
2015-03-26 02:42:24 -08:00
2017-01-26 09:43:32 -08:00