This commit is contained in:
Peter D. Gray 2024-03-26 09:56:10 -04:00
parent 6e40db4975
commit 086c0ec5c7
No known key found for this signature in database
GPG Key ID: A2DCD558C2BE5D7C

View File

@ -321,6 +321,8 @@ class Display:
return
def draw_qr_display(self, qr_data, msg, is_alnum, sidebar, idx_hint, invert):
# 'sidebar' is a pre-formated obj to show to right of QR -- oled life
# - 'msg' will appear to right if very short, else under in tiny
from utils import word_wrap
self.clear()
@ -362,7 +364,9 @@ class Display:
gly = framebuf.FrameBuffer(bytearray(packed), w, w, framebuf.MONO_HLSB)
self.dis.blit(gly, XO, YO, 1)
if not sidebar and len(msg) > (5*7):
if not sidebar and not msg:
pass
elif not sidebar and len(msg) > (5*7):
# use FontTiny and word wrap (will just split if no spaces)
x = bw + lm + 4
ww = ((128 - x)//4) - 1 # char width avail