diff --git a/clock.py b/clock.py index 9666dcb..af88600 100644 --- a/clock.py +++ b/clock.py @@ -979,21 +979,19 @@ class MyClockWidget(FloatLayout): if len(self.light_button_move_init) == 0: self.light_button_move_init = touch_curr.spos - # Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: ignore corrected touched - if touch_curr.corrected == False: - d = touch_curr.spos[0] - self.light_button_move_init[0] - threshold = 0.05 + d = touch_curr.spos[0] - self.light_button_move_init[0] + threshold = 0.05 - # Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: mirror d if position is on other side - if self.light_button_move_init[0] > 0.5: - d = -d + # Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: mirror d if position is on other side + if self.light_button_move_init[0] > 0.5: + d = -d - if d > 0.05: - # move to the right: set light to wake up level - self.light_state = "on" - elif d < -0.05: - # move to the left: set light off - self.light_state = "off" + if d > 0.05: + # move to the right: set light to wake up level + self.light_state = "on" + elif d < -0.05: + # move to the left: set light off + self.light_state = "off" super(MyClockWidget, self).on_touch_move(touch)