Skip to content

Commit a8f66fc

Browse files
committed
Suppress internal mouse.tile_motion deprecation warning
1 parent b692d78 commit a8f66fc

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
1414

1515
- Keyboard bitmask modifiers `tcod.event.KMOD_*` have been replaced by `tcod.event.Modifier`.
1616

17+
### Fixed
18+
19+
- Suppressed internal `mouse.tile_motion` deprecation warning.
20+
1721
## [16.2.3] - 2024-07-16
1822

1923
### Fixed

tcod/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def convert_event(self, event: _Event) -> _Event:
265265
event.position[0] - event.motion[0],
266266
event.position[1] - event.motion[1],
267267
)
268-
event_copy.motion = event.tile_motion = tcod.event.Point(
268+
event_copy.motion = event._tile_motion = tcod.event.Point(
269269
event._tile[0] - prev_tile[0], event._tile[1] - prev_tile[1]
270270
)
271271
return event_copy

tcod/event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def __init__(
486486
) -> None:
487487
super().__init__(position, tile, state)
488488
self.motion = Point(*motion)
489-
self.__tile_motion = Point(*tile_motion) if tile_motion is not None else None
489+
self._tile_motion = Point(*tile_motion) if tile_motion is not None else None
490490

491491
@property
492492
def pixel_motion(self) -> Point:
@@ -514,7 +514,7 @@ def tile_motion(self) -> Point:
514514
DeprecationWarning,
515515
stacklevel=2,
516516
)
517-
return _verify_tile_coordinates(self.__tile_motion)
517+
return _verify_tile_coordinates(self._tile_motion)
518518

519519
@tile_motion.setter
520520
def tile_motion(self, xy: tuple[int, int]) -> None:
@@ -524,7 +524,7 @@ def tile_motion(self, xy: tuple[int, int]) -> None:
524524
DeprecationWarning,
525525
stacklevel=2,
526526
)
527-
self.__tile_motion = Point(*xy)
527+
self._tile_motion = Point(*xy)
528528

529529
@classmethod
530530
def from_sdl_event(cls, sdl_event: Any) -> MouseMotion:

0 commit comments

Comments
 (0)