@@ -926,20 +926,6 @@ def __str__(self) -> str:
926
926
"""Return a simplified representation of this consoles contents."""
927
927
return "<%s>" % "\n " .join ("" .join (chr (c ) for c in line ) for line in self ._tiles ["ch" ])
928
928
929
- def _pythonic_index (self , x : int , y : int ) -> Tuple [int , int ]:
930
- if __debug__ and (x < 0 or y < 0 ):
931
- warnings .warn (
932
- "Negative indexes will be treated as absolute coordinates instead of relative in the future."
933
- " The current behavior of indexing from the end is deprecated." ,
934
- FutureWarning ,
935
- stacklevel = 3 ,
936
- )
937
- if x < 0 :
938
- x += self .width
939
- if y < 0 :
940
- y += self .height
941
- return x , y
942
-
943
929
def print (
944
930
self ,
945
931
x : int ,
@@ -972,8 +958,10 @@ def print(
972
958
973
959
.. versionchanged:: 9.0
974
960
`fg` and `bg` now default to `None` instead of white-on-black.
961
+
962
+ .. versionchanged:: 13.0
963
+ `x` and `y` are now always used as an absolute position for negative values.
975
964
"""
976
- x , y = self ._pythonic_index (x , y )
977
965
string_ = string .encode ("utf-8" ) # type: bytes
978
966
lib .TCOD_console_printn (
979
967
self .console_c ,
@@ -1025,8 +1013,10 @@ def print_box(
1025
1013
1026
1014
.. versionchanged:: 9.0
1027
1015
`fg` and `bg` now default to `None` instead of white-on-black.
1016
+
1017
+ .. versionchanged:: 13.0
1018
+ `x` and `y` are now always used as an absolute position for negative values.
1028
1019
"""
1029
- x , y = self ._pythonic_index (x , y )
1030
1020
string_ = string .encode ("utf-8" ) # type: bytes
1031
1021
return int (
1032
1022
lib .TCOD_console_printn_rect (
@@ -1095,6 +1085,9 @@ def draw_frame(
1095
1085
.. versionchanged:: 12.6
1096
1086
Added `decoration` parameter.
1097
1087
1088
+ .. versionchanged:: 13.0
1089
+ `x` and `y` are now always used as an absolute position for negative values.
1090
+
1098
1091
Example::
1099
1092
1100
1093
>>> console = tcod.Console(12, 6)
@@ -1115,7 +1108,6 @@ def draw_frame(
1115
1108
│ │
1116
1109
└─┤Lower├──┘>
1117
1110
"""
1118
- x , y = self ._pythonic_index (x , y )
1119
1111
if title and decoration != "┌─┐│ │└─┘" :
1120
1112
raise TypeError (
1121
1113
"The title and decoration parameters are mutually exclusive. You should print the title manually."
@@ -1195,8 +1187,10 @@ def draw_rect(
1195
1187
1196
1188
.. versionchanged:: 9.0
1197
1189
`fg` and `bg` now default to `None` instead of white-on-black.
1190
+
1191
+ .. versionchanged:: 13.0
1192
+ `x` and `y` are now always used as an absolute position for negative values.
1198
1193
"""
1199
- x , y = self ._pythonic_index (x , y )
1200
1194
lib .TCOD_console_draw_rect_rgb (
1201
1195
self .console_c ,
1202
1196
x ,
0 commit comments