What changed, and why it matters
This commit is a minor code cleanup in the user-interface component that handles horizontally scrolling text. It removes a leftover debug print statement and inlines a small helper function that crops and displays the scrolling text. There is no security-relevant change.
No security action needed; this is a routine refactoring/cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies src/seedsigner/gui/components.py in the TextArea horizontal-scroll thread. It deletes a debug print() and replaces a local _render_text() closure with inline code that crops rendered_text_img, pastes it onto the canvas, and calls show_image(). It also tightens a truthiness check from if cur_hold_duration: to if cur_hold_duration is not None:. No input handling, cryptography, permissions, network, or secret-handling code is touched.
Changed components
src/seedsigner.gui.components.TextArea.HorizontalTextScrollThreadInspect captured patch +5 / −14
diff --git a/src/seedsigner/gui/components.py b/src/seedsigner/gui/components.py
index 0507969..d3012e5 100644
--- a/src/seedsigner/gui/components.py
+++ b/src/seedsigner/gui/components.py
@@ -596,7 +596,6 @@ class TextArea(BaseComponent):
self.horizontal_text_scroll_thread: TextArea.HorizontalTextScrollThread = None
if self.is_horizontal_scrolling_enabled:
- print(f"CREATING scrollable thread for \"{self.text}\"")
self.horizontal_text_scroll_thread = TextArea.HorizontalTextScrollThread(
rendered_text_img=self.rendered_text_img,
screen_x=self.screen_x + self.min_text_x,
@@ -650,20 +649,10 @@ class TextArea(BaseComponent):
50px/sec creates a slight ghosting / doubling effect that impedes
readability. 45px/sec is better but still perceptually a bit stuttery.
"""
- def _render_text():
- img = self.rendered_text_img.crop(
- (
- self.horizontal_scroll_position, 0, # (x,y) top left
- self.horizontal_scroll_position + self.visible_width, self.rendered_text_img.height # (x,y) bottom right
- )
- )
- self.renderer.canvas.paste(img, (self.screen_x, self.screen_y - self.scroll_y))
- self.renderer.show_image()
-
max_scroll = self.rendered_text_img.width - self.visible_width
# The scrolling holds / pauses at the start and end of the text line. These
- # vars track when we started holding and how long we should hold.
+ # vars track when we started holding and how long we should hold for.
hold_started_at = None
cur_hold_duration = None
@@ -672,7 +661,7 @@ class TextArea(BaseComponent):
time.sleep(0.1)
continue
- if cur_hold_duration:
+ if cur_hold_duration is not None:
hold_time_elapsed = time.time() - hold_started_at
if hold_time_elapsed < cur_hold_duration:
# Still holding; skip scrolling logic
@@ -685,7 +674,9 @@ class TextArea(BaseComponent):
continue
# Render the latest scroll update
- _render_text()
+ img = self.rendered_text_img.crop((self.horizontal_scroll_position, 0, self.horizontal_scroll_position + self.visible_width, self.rendered_text_img.height))
+ self.renderer.canvas.paste(img, (self.screen_x, self.screen_y - self.scroll_y))
+ self.renderer.show_image()
if hold_started_at is not None:
# If we're here, we've held long enough; reset the vars and resume
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.