Skip to content

Commit 7441170

Browse files
committed
Simplify grid bounds unpacking
1 parent cfb3f13 commit 7441170

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

adafruit_displayio_layout/layouts/grid_layout.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,8 @@ def add_content(
378378
then the cell_anchor_point from the GridLayout will be used.
379379
:return: None"""
380380

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]
381+
grid_x, grid_y = grid_position
382+
max_grid_x, max_grid_y = self.grid_size
385383
if grid_x >= max_grid_x or grid_y >= max_grid_y:
386384
raise ValueError(
387385
f"Grid position {grid_position} is out of bounds for grid size {self.grid_size}"

0 commit comments

Comments
 (0)