Skip to content

Commit

Permalink
Fix display notification. #859
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed Dec 10, 2023
1 parent 260dd6c commit 024d45c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hardware/display/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,12 @@ def write_text(self, text="", line=1):

# print('Font width: {} -> {} / {} = {}'.format(self._device['fontwidth'], self.width, self._device['fontwidth'], self.width / self._device['fontwidth']))
# print('Max chars on 1 line: {}'.format(max_chars_per_line))
text = text.split("\n")
text = text.strip().split("\n")
if self.__MODE_TEXT_WRAP == self.mode:
text = [textwrap.wrap(line, width=max_chars_per_line) for line in text]
temp_lines = []
for line in text:
temp_lines += textwrap.wrap(line, width=max_chars_per_line)
text = temp_lines

self.clear()

Expand Down

0 comments on commit 024d45c

Please sign in to comment.