@@ -101,16 +101,26 @@ def _update_text(self, new_text): # pylint: disable=too-many-locals
101101 position_y = y - glyph .height - glyph .dy + y_offset
102102 position_x = x + glyph .dx
103103 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 )
108114 if i < len (self ):
109115 self [i ] = face
110116 else :
111117 self .append (face )
112118 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
114124
115125 x += glyph .shift_x
116126
0 commit comments