mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 14:21:33 +03:00
Assert a few more specific types
This commit is contained in:
parent
2a7427c5c8
commit
3b2b383595
2
paint.py
2
paint.py
@ -359,6 +359,7 @@ class CharInput(Input):
|
|||||||
def on_click(self, event: events.Click) -> None:
|
def on_click(self, event: events.Click) -> None:
|
||||||
"""Detect double click and open character selector dialog."""
|
"""Detect double click and open character selector dialog."""
|
||||||
if event.time - self.last_click_time < 0.8:
|
if event.time - self.last_click_time < 0.8:
|
||||||
|
assert isinstance(self.app, PaintApp)
|
||||||
self.app.action_open_character_selector()
|
self.app.action_open_character_selector()
|
||||||
self.last_click_time = event.time
|
self.last_click_time = event.time
|
||||||
|
|
||||||
@ -883,6 +884,7 @@ class Canvas(Widget):
|
|||||||
# This seems like a bug.
|
# This seems like a bug.
|
||||||
# I think it's due to coordinates being calculated differently during mouse capture.
|
# I think it's due to coordinates being calculated differently during mouse capture.
|
||||||
if self.pointer_active:
|
if self.pointer_active:
|
||||||
|
assert isinstance(self.parent, Widget)
|
||||||
event.x += int(self.parent.scroll_x)
|
event.x += int(self.parent.scroll_x)
|
||||||
event.y += int(self.parent.scroll_y)
|
event.y += int(self.parent.scroll_y)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user