Skip to content

Commit f4f4521

Browse files
authored
Clarify error message when the atlas is full (#2555)
* Clarify error message when the atlas is full * Unnecessary f-string * Fix annotation issues in the draw module * Import sorting
1 parent 11d1eba commit f4f4521

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

arcade/draw/line.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import array
22

33
from arcade import gl
4-
from arcade.types import Color, Point2List, RGBOrA255
4+
from arcade.types import Color, Point2, Point2List, RGBOrA255
55
from arcade.window_commands import get_window
66

77
from .helpers import _generic_draw_line_strip, get_points_for_thick_line
@@ -23,8 +23,8 @@ def draw_line_strip(point_list: Point2List, color: RGBOrA255, line_width: float
2323
if line_width == 1:
2424
_generic_draw_line_strip(point_list, color, gl.LINE_STRIP)
2525
else:
26-
triangle_point_list: Point2List = []
27-
# This needs a lot of improvement
26+
triangle_point_list: list[Point2] = []
27+
# FIXME: This needs a lot of improvement
2828
last_point = None
2929
for point in point_list:
3030
if last_point is not None:

arcade/draw/polygon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from arcade import gl
22
from arcade.earclip import earclip
3-
from arcade.types import Point2List, RGBOrA255
3+
from arcade.types import Point2, Point2List, RGBOrA255
44

55
from .helpers import _generic_draw_line_strip, get_points_for_thick_line
66

@@ -40,7 +40,7 @@ def draw_polygon_outline(point_list: Point2List, color: RGBOrA255, line_width: f
4040
new_point_list.append(point_list[0])
4141

4242
# Create a place to store the triangles we'll use to thicken the line
43-
triangle_point_list = []
43+
triangle_point_list: list[Point2] = []
4444

4545
# This needs a lot of improvement
4646
last_point = None

arcade/texture_atlas/uv_data.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ def get_existing_or_free_slot(self, name: str) -> int:
124124
return slot
125125
except IndexError:
126126
raise Exception(
127-
("No more free slots in the UV texture. " f"Max number of slots: {self._num_slots}")
127+
(
128+
"No more free slots in the UV texture."
129+
f"Max number of textures: {self._num_slots}."
130+
"Consider creating a texture atlas with a larger capacity."
131+
)
128132
)
129133

130134
def free_slot_by_name(self, name: str) -> None:

0 commit comments

Comments
 (0)