You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated my libraries (from adafruit-circuitpython-bundle-5.x-mpy-20200625) and tried this,
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit CLUE nRF52840 Express with nRF52840
>>> import terminalio, displayio, board
>>> from adafruit_display_text import label
>>> text_area = label.Label(terminalio.FONT, text="Scale!", scale=5, color=0xc0c0c0)
>>> board.DISPLAY.show(text_area)
>>> text_area.anchor_point
(0, 0)
>>> text_area.anchored_position
(0, -7)
>>> text_area.anchored_position = (0, 0) ### expectation is text will be on screen at top left
The position of that text is not entirely on screen, the top is chopped off. This is presumably due to issues with a scale which isn't the default value of 1. Discussed this a little bit recently with @FoamyGuy in Discord.
The text was updated successfully, but these errors were encountered:
I think the root of this issue is that the scale=5 parameter doesn't really belong to the Label, and Label isn't taking it into account for anything or really doing anything with it, except passing it through to the super class Group __init__() here:
using some arcane pythonic magic involving **kwargs
I think in order for anchor_point and anchored_position to play nicely with scaled text we need to capture the scale factor and keep it inside of Label and use it to when we calculate the new location.
I will try to take an attempt at making these changes.
I updated my libraries (from
adafruit-circuitpython-bundle-5.x-mpy-20200625
) and tried this,The position of that text is not entirely on screen, the top is chopped off. This is presumably due to issues with a
scale
which isn't the default value of1
. Discussed this a little bit recently with @FoamyGuy in Discord.The text was updated successfully, but these errors were encountered: