@@ -101,16 +101,26 @@ def _update_text(self, new_text): # pylint: disable=too-many-locals
101
101
position_y = y - glyph .height - glyph .dy + y_offset
102
102
position_x = x + glyph .dx
103
103
if not self ._text or old_c >= len (self ._text ) or character != self ._text [old_c ]:
104
- face = displayio .TileGrid (glyph .bitmap , pixel_shader = self .palette ,
105
- default_tile = glyph .tile_index ,
106
- tile_width = glyph .width , tile_height = glyph .height ,
107
- position = (position_x , position_y ))
104
+ try :
105
+ face = displayio .TileGrid (glyph .bitmap , pixel_shader = self .palette ,
106
+ default_tile = glyph .tile_index ,
107
+ tile_width = glyph .width , tile_height = glyph .height ,
108
+ position = (position_x , position_y ))
109
+ except TypeError :
110
+ face = displayio .TileGrid (glyph .bitmap , pixel_shader = self .palette ,
111
+ default_tile = glyph .tile_index ,
112
+ tile_width = glyph .width , tile_height = glyph .height ,
113
+ x = position_x , y = position_y )
108
114
if i < len (self ):
109
115
self [i ] = face
110
116
else :
111
117
self .append (face )
112
118
elif self ._text and character == self ._text [old_c ]:
113
- self [i ].position = (position_x , position_y )
119
+ try :
120
+ self [i ].position = (position_x , position_y )
121
+ except AttributeError :
122
+ self [i ].x = position_x
123
+ self [i ].y = position_y
114
124
115
125
x += glyph .shift_x
116
126
0 commit comments