I believe this is a new bug:
import ui,console
class Touchy(ui.View):
def __init__(self,*args,**kwargs):
ui.View.__init__(self,*args,**kwargs)
self.add_subview(ui.View(frame=(300,300,44,44),bg_color='red'))
def touch_began(self,touch):
console.hud_alert('{p.x},{p.y}'.format(p=touch.location))
v=Touchy(frame=(0,0,600,600)).present('sheet')
Touch near but not on the red square.
Result, a value near 300,300, as expected.
Now touch the red square:
result is touch location relative to the subview coords, rather than the custom view.
I believe the way it used to work is that a Touch location was the location relative to the custom view which implemented the touch methods. This makes more sense, since a Touch does not contain any info about which subview was touched.
As is, it is impossible to know where you actually touched, if implementing touch on a View subclass which has subviews which are vanilla View's.
I am pretty sure this used to work properly, but I'm not sure.