button: fix grabbing priority in touch move/up

This commit is contained in:
Mathieu Virbel 2012-03-01 23:45:19 +01:00
parent 625528db29
commit 6c1430d3c2
1 changed files with 3 additions and 3 deletions

View File

@ -126,15 +126,15 @@ class Button(Label):
return True
def on_touch_move(self, touch):
if touch.grab_current is self:
return True
if super(Button, self).on_touch_move(touch):
return True
return self in touch.ud
def on_touch_up(self, touch):
if super(Button, self).on_touch_up(touch):
return True
if touch.grab_current is not self:
return
return super(Button, self).on_touch_up(touch)
assert(self in touch.ud)
touch.ungrab(self)
self._do_release()