mirror of https://github.com/kivy/kivy.git
Merge pull request #4784 from inclement/fix_selector
Made sure Selector gets on_touch_down only once
This commit is contained in:
commit
faa71edf73
|
@ -227,7 +227,6 @@ class Selector(ButtonBehavior, Image):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Selector, self).__init__(**kwargs)
|
super(Selector, self).__init__(**kwargs)
|
||||||
self.window.bind(on_touch_down=self.on_window_touch_down)
|
|
||||||
self.matrix = self.target.get_window_matrix()
|
self.matrix = self.target.get_window_matrix()
|
||||||
|
|
||||||
with self.canvas.before:
|
with self.canvas.before:
|
||||||
|
@ -250,8 +249,8 @@ class Selector(ButtonBehavior, Image):
|
||||||
touch.apply_transform_2d(
|
touch.apply_transform_2d(
|
||||||
lambda x, y: matrix.transform_point(x, y, 0)[:2])
|
lambda x, y: matrix.transform_point(x, y, 0)[:2])
|
||||||
|
|
||||||
def on_window_touch_down(self, win, touch):
|
def on_touch_down(self, touch):
|
||||||
if self.parent is not win:
|
if self.parent is not EventLoop.window:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue