Commit c1ef53c
committed
Some touch EventMotion instances (like MTDMotionEvent) do not have a button attribute.
This fixes crashes like
File "/usr/local/lib/python2.7/dist-packages/kivy/uix/widget.py", line 432, in on_touch_down
if child.dispatch('on_touch_down', touch):
File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-build-Q1Kayw/kivy/kivy/_event.c:7699)
File "/home/pi/.kivy/garden/garden.matplotlib/backend_kivy.py", line 1067, in on_touch_down
if(touch.button == "scrollup" or touch.button == "scrolldown"):
AttributeError: 'MTDMotionEvent' object has no attribute 'button'1 parent 0e549e9 commit c1ef53c
1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | | - | |
| 1067 | + | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | 1111 | | |
| |||
1115 | 1116 | | |
1116 | 1117 | | |
1117 | 1118 | | |
1118 | | - | |
| 1119 | + | |
1119 | 1120 | | |
1120 | 1121 | | |
1121 | 1122 | | |
| |||
0 commit comments