Skip to content

Commit c8a704c

Browse files
committed
Fix wrong literal annotations for WindowResized.
1 parent 0c11467 commit c8a704c

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
77
### Changed
88
- Using `libtcod 1.24.0`.
99

10+
### Fixed
11+
- `WindowResized` literal annotations were in the wrong case.
12+
1013
## [16.0.3] - 2023-06-04
1114
### Changed
1215
- Enabled logging for libtcod and SDL.

docs/tcod/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Example::
112112
print(event) # Print event names and attributes.
113113
if isinstance(event, tcod.event.Quit):
114114
raise SystemExit()
115-
elif isinstance(event, tcod.event.WindowResized) and event.type == "WINDOWRESIZED":
115+
elif isinstance(event, tcod.event.WindowResized) and event.type == "WindowSizeChanged":
116116
pass # The next call to context.new_console may return a different size.
117117

118118

examples/eventget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def main() -> None:
4141
print(repr(event))
4242
if isinstance(event, tcod.event.Quit):
4343
raise SystemExit()
44-
if isinstance(event, tcod.event.WindowResized) and event.type == "WINDOWRESIZED":
44+
if isinstance(event, tcod.event.WindowResized) and event.type == "WindowSizeChanged":
4545
console = context.new_console()
4646
if isinstance(event, tcod.event.ControllerDevice):
4747
if event.type == "CONTROLLERDEVICEADDED":

examples/ttf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def main() -> None:
8181
for event in tcod.event.wait():
8282
if isinstance(event, tcod.event.Quit):
8383
raise SystemExit()
84-
if isinstance(event, tcod.event.WindowResized) and event.type == "WINDOWSIZECHANGED":
84+
if isinstance(event, tcod.event.WindowResized) and event.type == "WindowSizeChanged":
8585
# Resize the Tileset to match the new screen size.
8686
context.change_tileset(
8787
load_ttf(

tcod/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,8 @@ class WindowResized(WindowEvent):
827827
height (int): The current height of the window.
828828
"""
829829

830-
type: Final[Literal["WINDOWRESIZED", "WINDOWSIZECHANGED"]] # type: ignore[assignment,misc]
831-
"""WINDOWRESIZED" or "WINDOWSIZECHANGED"""
830+
type: Final[Literal["WindowResized", "WindowSizeChanged"]] # type: ignore[misc]
831+
"""WindowResized" or "WindowSizeChanged"""
832832

833833
def __init__(self, type: str, width: int, height: int) -> None:
834834
super().__init__(type)

0 commit comments

Comments
 (0)