File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
adafruit_displayio_layout/layouts Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -79,15 +79,20 @@ def _layout_cells(self):
7979 ),
8080 )
8181 else :
82- # try width and height properties.
83- cell ["content" ].width = (
84- int (button_size_x * self ._width / grid_size_x )
85- - 2 * self .cell_padding
86- )
87- cell ["content" ].height = (
88- int (button_size_y * self ._height / grid_size_y )
89- - 2 * self .cell_padding
90- )
82+ try :
83+ # try width and height properties.
84+ cell ["content" ].width = (
85+ int (button_size_x * self ._width / grid_size_x )
86+ - 2 * self .cell_padding
87+ )
88+ cell ["content" ].height = (
89+ int (button_size_y * self ._height / grid_size_y )
90+ - 2 * self .cell_padding
91+ )
92+ except AttributeError :
93+ # This element does not allow setting width and height.
94+ # No problem, we'll use whatever size it already is.
95+ pass
9196
9297 cell ["content" ].x = (
9398 int (grid_position_x * self ._width / grid_size_x ) + self .cell_padding
You can’t perform that action at this time.
0 commit comments