Closed shi-weili closed 5 years ago
What a great catch! Must have resulted in some annoying debugging :/ I'll review more closely tomorrow, but think that there may be a slightly more safe place to put this that's less prone to be overridden. Thanks for investigating and fixing this!
@shi-weili Not urgent, but I think before we merge this in, these places would be better to call invalidate from since those are less prone to being overridden by subclasses:
This will also help with removing children from parents (e.g. if you plan on using a view in an FBO or outside of the view hierarchy).
@shi-weili bumping this so we can merge these fixes in. When you're back, could you take a quick peek?
@benjaminbojko Thanks for the suggestions! I've moved the invalidate()
call to places you recommended. Quickly compiled a sample project to confirm that the touch sensing still works correctly.
Beautiful. Thanks @shi-weili .
@benjaminbojko I think that the transform of a view need to be invalidated if this view is added to a new parent. Otherwise, touches might not be captured correctly. Its effective touch area will be the old, wrong one, while the view draws in its new, correct position.