Skip to content

Commit 5284071

Browse files
authored
Merge pull request #28 from hnohmi/branch-line_spacing
Added line_spacing to add_text
2 parents f19cfe7 + 045fb8a commit 5284071

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adafruit_matrixportal/matrixportal.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def __init__(
126126
self._text_scrolling = []
127127
self._scrolling_index = None
128128
self._text_font = terminalio.FONT
129+
self._text_line_spacing = []
129130

130131
gc.collect()
131132

@@ -139,6 +140,7 @@ def add_text(
139140
text_maxlen=0,
140141
text_transform=None,
141142
scrolling=False,
143+
line_spacing=1.25,
142144
):
143145
"""
144146
Add text labels with settings
@@ -183,6 +185,7 @@ def add_text(
183185
self._text_maxlen.append(text_maxlen)
184186
self._text_transform.append(text_transform)
185187
self._text_scrolling.append(scrolling)
188+
self._text_line_spacing.append(line_spacing)
186189

187190
if scrolling and self._scrolling_index is None: # Not initialized yet
188191
self._scrolling_index = self._get_next_scrollable_text_index()
@@ -267,6 +270,7 @@ def set_text(self, val, index=0):
267270
self._text[index].color = self._text_color[index]
268271
self._text[index].x = self._text_position[index][0]
269272
self._text[index].y = self._text_position[index][1]
273+
self._text[index].line_spacing = self._text_line_spacing[index]
270274
elif index_in_splash is not None:
271275
self._text[index] = None
272276

0 commit comments

Comments
 (0)