We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d60431 commit 8f8a8a7Copy full SHA for 8f8a8a7
adafruit_display_text/__init__.py
@@ -72,8 +72,10 @@ def measure(text):
72
for char in word:
73
if newline:
74
extraspace = 0
75
+ leadchar = ""
76
else:
77
extraspace = swidth
78
+ leadchar = " "
79
if (
80
measure("".join(partial))
81
+ measure(cur_part)
@@ -83,12 +85,10 @@ def measure(text):
83
85
> max_width
84
86
):
87
if cur_part:
- if newline:
- word_parts.append("".join(partial) + cur_part + "-")
88
- else:
89
- word_parts.append(
90
- "".join(partial) + " " + cur_part + "-"
91
- )
+ word_parts.append(
+ "".join(partial) + leadchar + cur_part + "-"
+ )
+
92
93
word_parts.append("".join(partial))
94
cur_part = char
0 commit comments