Skip to content

Conversation

@Neradoc
Copy link
Contributor

@Neradoc Neradoc commented Jun 5, 2021

The actual length of the text was not tested in set_text, the mere existence of maxlen was enough to shorten the string, or add "..." if the string was shorter than maxlen - 3.

The actual length of the text was not tested in set_text, the mere existence of `maxlen` was enough to shorten the string, or add `"..."` if the string was shorter than `maxlen - 3`.
@ladyada ladyada requested review from FoamyGuy and makermelissa June 5, 2021 16:47
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

I tested this successfully with a pyportal and this code by tweaking maxlen value:

import board
from adafruit_pyportal import PyPortal


# Create the PyPortal object
pyportal = PyPortal()

# Set display to show REPL
# board.DISPLAY.show(None)

pyportal.add_text(
    text="Hello World", 
    text_color=0xFFFFFF, 
    text_position=(50, 50),
    text_maxlen=8
)

while True:
    pass

Confirmed the issue noted and the fix from this change.

@FoamyGuy FoamyGuy merged commit 60c9181 into adafruit:main Jun 5, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants