fix: multisg address display

This commit is contained in:
scgbckbone 2025-02-12 10:02:40 +01:00 committed by doc-hex
parent 660b4617bd
commit 7e6be45e2d

View File

@ -489,13 +489,10 @@ def word_wrap(ln, w):
# special handling for lines w/ payment address in them
# - add same marker to newly split lines
addr = ln[1:]
if version.has_qwerty:
# - do line break in middle, on mod4 boundry
# - will not work if addresses are > 2 lines long (34*2 chars)
aw = ((len(addr) // 2) + 3) & ~3
else:
# - simply 3 4-char groups on Mk4
aw = 12
# - 3 4-char groups on Mk4
# - 6 4-char groups on Q
aw = 24 if version.has_qwerty else 12
pos = 0
while pos < len(addr):
yield OUT_CTRL_ADDRESS + addr[pos:pos+aw]
@ -518,9 +515,6 @@ def word_wrap(ln, w):
# not clear when this would happen? final bit??
left = left + ' ' + ln
ln = ''
else:
if ln and ln[0] == ' ' and version.has_qwerty:
ln = " " + ln
yield left