Skip to content

Commit

Permalink
py36 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Oct 5, 2021
1 parent 5f6ac05 commit 147776f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
env
venv*/
.venv
.venv36

# docs
/doc/resources.rst
Expand Down
12 changes: 6 additions & 6 deletions arcade/gui/ui_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,29 +219,29 @@ def dispatch_ui_event(self, event):

def on_mouse_motion(self, x: float, y: float, dx: float, dy: float):
x, y = self.adjust_mouse_coordinates(x, y)
self.dispatch_ui_event(UIMouseMovementEvent(self, x, y, dx, dy))
self.dispatch_ui_event(UIMouseMovementEvent(self, x, y, dx, dy)) # type: ignore

def on_mouse_press(self, x: float, y: float, button: int, modifiers: int):
x, y = self.adjust_mouse_coordinates(x, y)
self.dispatch_ui_event(UIMousePressEvent(self, x, y, button, modifiers))
self.dispatch_ui_event(UIMousePressEvent(self, x, y, button, modifiers)) # type: ignore

def on_mouse_drag(self, x: float, y: float, dx: float, dy: float, buttons: int, modifiers: int):
x, y = self.adjust_mouse_coordinates(x, y)
self.dispatch_ui_event(UIMouseDragEvent(self, x, y, dx, dy, buttons, modifiers))
self.dispatch_ui_event(UIMouseDragEvent(self, x, y, dx, dy, buttons, modifiers)) # type: ignore

def on_mouse_release(self, x: float, y: float, button: int, modifiers: int):
x, y = self.adjust_mouse_coordinates(x, y)
self.dispatch_ui_event(UIMouseReleaseEvent(self, x, y, button, modifiers))
self.dispatch_ui_event(UIMouseReleaseEvent(self, x, y, button, modifiers)) # type: ignore

def on_mouse_scroll(self, x, y, scroll_x, scroll_y):
x, y = self.adjust_mouse_coordinates(x, y)
self.dispatch_ui_event(UIMouseScrollEvent(self, x, y, scroll_x, scroll_y))

def on_key_press(self, symbol: int, modifiers: int):
self.dispatch_ui_event(UIKeyPressEvent(self, symbol, modifiers))
self.dispatch_ui_event(UIKeyPressEvent(self, symbol, modifiers)) # type: ignore

def on_key_release(self, symbol: int, modifiers: int):
self.dispatch_ui_event(UIKeyReleaseEvent(self, symbol, modifiers))
self.dispatch_ui_event(UIKeyReleaseEvent(self, symbol, modifiers)) # type: ignore

def on_text(self, text):
self.dispatch_ui_event(UITextEvent(self, text))
Expand Down
2 changes: 1 addition & 1 deletion arcade/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def on_event(self, event: UIEvent) -> Optional[bool]:
self.pressed = False
if self.rect.collide_with_point(event.x, event.y):
# Dispatch new on_click event, source is this widget itself
self.dispatch_event("on_event", UIOnClickEvent(self, event.x, event.y))
self.dispatch_event("on_event", UIOnClickEvent(self, event.x, event.y)) # type: ignore
return EVENT_HANDLED

if isinstance(event, UIOnClickEvent) and self.rect.collide_with_point(event.x, event.y):
Expand Down
2 changes: 1 addition & 1 deletion arcade/tilemap/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def _create_sprite_from_tile(
)
texture = None # type: ignore

key_frame = AnimationKeyframe(
key_frame = AnimationKeyframe( # type: ignore
frame.tile_id, frame.duration, texture
)
key_frame_list.append(key_frame)
Expand Down

0 comments on commit 147776f

Please sign in to comment.