Skip to content

Commit b4d30a2

Browse files
committed
solid background seems a hair faster
1 parent 952c334 commit b4d30a2

File tree

1 file changed

+8
-8
lines changed
  • CircuitPython_GetSuperpower_PicoW_OpenAI

1 file changed

+8
-8
lines changed

CircuitPython_GetSuperpower_PicoW_OpenAI/code.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# Invent an alien animal or plant, name it, and vividly describe it in 1
4949
# sentence
5050
#
51-
# Write 1 setence starting "you can" about an unconventional but useful superpower
51+
# Write 1 setence starting "you can" about an unconventional but useful superpower
5252
prompt=os.getenv("MY_PROMPT", """
5353
Invent and vividly describe an alien species. write one paragraph
5454
""").strip()
@@ -93,7 +93,7 @@ def make_label(self, text, y):
9393
result = Label(
9494
font=nice_font,
9595
color=0xFFFFFF,
96-
background_color=None,
96+
background_color=0,
9797
line_spacing=line_spacing,
9898
anchor_point=(0, 0),
9999
anchored_position=(0, y),
@@ -140,13 +140,13 @@ def refresh(self):
140140
lines = self.lines
141141
# update labels from wrapped text, accounting for scroll offset
142142
for i in range(len(self)):
143-
line = i + self.offset
144-
if line >= len(lines):
145-
content = ""
143+
offset_i = i + self.offset
144+
if offset_i >= len(lines):
145+
text = ""
146146
else:
147-
content = lines[line]
148-
if content != self[i].text:
149-
self[i].text = content
147+
text = lines[offset_i]
148+
if text != self[i].text:
149+
self[i].text = text
150150

151151
# Actually update the display all at once
152152
display.refresh()

0 commit comments

Comments
 (0)