Skip to content

Commit b6a4628

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

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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)