We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d089bc commit cfb3f13Copy full SHA for cfb3f13
adafruit_displayio_layout/layouts/grid_layout.py
@@ -378,6 +378,15 @@ def add_content(
378
then the cell_anchor_point from the GridLayout will be used.
379
:return: None"""
380
381
+ grid_x = grid_position[0]
382
+ grid_y = grid_position[1]
383
+ max_grid_x = self.grid_size[0]
384
+ max_grid_y = self.grid_size[1]
385
+ if grid_x >= max_grid_x or grid_y >= max_grid_y:
386
+ raise ValueError(
387
+ f"Grid position {grid_position} is out of bounds for grid size {self.grid_size}"
388
+ )
389
+
390
if cell_anchor_point:
391
_this_cell_anchor_point = cell_anchor_point
392
else:
0 commit comments