@@ -87,8 +87,8 @@ def __init__(self, font, **kwargs) -> None:
87
87
88
88
text = self ._replace_tabs (self ._text )
89
89
90
- self .width = len (text )
91
- self .height = self ._font .get_bounding_box ()[1 ]
90
+ self ._width = len (text )
91
+ self ._height = self ._font .get_bounding_box ()[1 ]
92
92
93
93
# Create the two-color text palette
94
94
self ._palette [0 ] = 0
@@ -119,7 +119,7 @@ def _create_background_box(self, lines: int, y_offset: int) -> TileGrid:
119
119
x_box_offset = - self ._padding_bottom
120
120
box_width = (
121
121
(ascent + descent )
122
- + int ((lines - 1 ) * self .width * self ._line_spacing )
122
+ + int ((lines - 1 ) * self ._width * self ._line_spacing )
123
123
+ self ._padding_left
124
124
+ self ._padding_right
125
125
)
@@ -130,7 +130,7 @@ def _create_background_box(self, lines: int, y_offset: int) -> TileGrid:
130
130
x_box_offset = - self ._padding_left
131
131
box_height = (
132
132
(ascent + descent )
133
- + int ((lines - 1 ) * self .height * self ._line_spacing )
133
+ + int ((lines - 1 ) * self ._height * self ._line_spacing )
134
134
+ self ._padding_top
135
135
+ self ._padding_bottom
136
136
)
@@ -248,7 +248,7 @@ def _update_text(self, new_text: str) -> None:
248
248
249
249
for character in new_text :
250
250
if character == "\n " :
251
- y += int (self .height * self ._line_spacing )
251
+ y += int (self ._height * self ._line_spacing )
252
252
x = 0
253
253
continue
254
254
glyph = self ._font .get_glyph (ord (character ))
@@ -402,7 +402,7 @@ def _set_font(self, new_font) -> None:
402
402
current_anchored_position = self .anchored_position
403
403
self ._text = ""
404
404
self ._font = new_font
405
- self .height = self ._font .get_bounding_box ()[1 ]
405
+ self ._height = self ._font .get_bounding_box ()[1 ]
406
406
self ._update_text (str (old_text ))
407
407
self .anchored_position = current_anchored_position
408
408
0 commit comments