Merge pull request #4784 from inclement/fix_selector

Made sure Selector gets on_touch_down only once
This commit is contained in:
dessant 2017-01-16 13:18:43 +02:00 committed by GitHub
commit faa71edf73
1 changed files with 2 additions and 3 deletions

View File

@ -227,7 +227,6 @@ class Selector(ButtonBehavior, Image):
def __init__(self, **kwargs):
super(Selector, self).__init__(**kwargs)
self.window.bind(on_touch_down=self.on_window_touch_down)
self.matrix = self.target.get_window_matrix()
with self.canvas.before:
@ -250,8 +249,8 @@ class Selector(ButtonBehavior, Image):
touch.apply_transform_2d(
lambda x, y: matrix.transform_point(x, y, 0)[:2])
def on_window_touch_down(self, win, touch):
if self.parent is not win:
def on_touch_down(self, touch):
if self.parent is not EventLoop.window:
return
try: