Skip to content

Added line_spacing to add_text #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions adafruit_matrixportal/matrixportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def __init__(
self._text_scrolling = []
self._scrolling_index = None
self._text_font = terminalio.FONT
self._text_line_spacing = []

gc.collect()

Expand All @@ -139,6 +140,7 @@ def add_text(
text_maxlen=0,
text_transform=None,
scrolling=False,
line_spacing=1.25,
):
"""
Add text labels with settings
Expand Down Expand Up @@ -183,6 +185,7 @@ def add_text(
self._text_maxlen.append(text_maxlen)
self._text_transform.append(text_transform)
self._text_scrolling.append(scrolling)
self._text_line_spacing.append(line_spacing)

if scrolling and self._scrolling_index is None: # Not initialized yet
self._scrolling_index = self._get_next_scrollable_text_index()
Expand Down Expand Up @@ -267,6 +270,7 @@ def set_text(self, val, index=0):
self._text[index].color = self._text_color[index]
self._text[index].x = self._text_position[index][0]
self._text[index].y = self._text_position[index][1]
self._text[index].line_spacing = self._text_line_spacing[index]
elif index_in_splash is not None:
self._text[index] = None

Expand Down