File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11/dist /
2+ /.idea /
23/.vscode /
34__pycache__
Original file line number Diff line number Diff line change @@ -216,18 +216,22 @@ def _scroll_viewport(self, event: tk.Event):
216216
217217 :param event: Scroll event.
218218 """
219- # Select which method to call based on whether Shift was held down.
220- # This is indicated by the LSB of the state.
221- callee = self ._xview if event .state & 1 else self ._yview
222219 match _system :
223220 case "Linux" if event .num == 4 :
224- callee ( tk . SCROLL , - 1 , tk . UNITS )
221+ amount = - 1
225222 case "Linux" if event .num == 5 :
226- callee ( tk . SCROLL , 1 , tk . UNITS )
223+ amount = 1
227224 case "Darwin" :
228- callee ( tk . SCROLL , - event .delta , tk . UNITS )
225+ amount = - event .delta
229226 case "Windows" :
230- callee ( tk . SCROLL , - event .delta // 120 , tk . UNITS )
227+ amount = - event .delta // 120
231228 case _:
232229 message = f"event { event .num } on OS { _system !r} is not supported"
233230 raise ValueError (message )
231+
232+ # Select the method to call based on whether Shift was held down. This
233+ # is indicated by the LSB of the state.
234+ if event .state & 1 :
235+ self ._xview (tk .SCROLL , amount , tk .UNITS )
236+ else :
237+ self ._yview (tk .SCROLL , amount , tk .UNITS )
You can’t perform that action at this time.
0 commit comments