File tree 1 file changed +14
-9
lines changed
adafruit_displayio_layout/layouts
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):
79
79
),
80
80
)
81
81
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
91
96
92
97
cell ["content" ].x = (
93
98
int (grid_position_x * self ._width / grid_size_x ) + self .cell_padding
You can’t perform that action at this time.
0 commit comments