Closed ephemer closed 6 years ago
@michaelknoch @rikner @cshg hitTest
and absoluteOrigin
are now both working as expected with transforms. https://github.com/flowkey/UIKit-SDL/pull/144/commits/31e0bd54bb8d0973a97bd1932514c4b084e0b082 is the relevant change for absoluteOrigin. Feel free to test and hopefully merge this, and then point #147 at master and merge it too if you think it's ready.
Nice to have improvements:
absoluteOrigin
should be private to UIView. Instead we should use convert(view.bounds.origin, to: window)
. We only use absoluteOrigin
in two places, both of which are in UITouch.swift
. @michaelknoch this would be a good reason to implement the UITouch.window instance property: we could then replace the absoluteOrigin
call with the one above. The tests can be easily fit to use the public API as well deepestSubview.convert(deepestSubview.bounds.origin, to: rootView)
. I am not certain this will work, but I can't imagine how else iOS does it, and we call (the then private) absoluteOrigin
anyway in our slow path for convert
.convert
functions in UIView into their own file. this would be useful for cleaning up the private functions too.It's probably a good idea to merge rather than squash this PR, because there's quite a bit happening and the commits are somewhat reasonably split into logical units
We now have working transforms - nested and otherwise. I haven't tested this with rotations, but since we're not using them I didn't think this was necessary. That said, most of the hard work of this implementation is done by the GPU, so there's no good reason they shouldn't work too.
What appears to not be working yet is: