Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix anchored positioning for TextBox #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

FoamyGuy
Copy link
Contributor

@FoamyGuy FoamyGuy commented May 27, 2025

Resolves: #221

_reset_text() was erroneously setting the self._bounding_box width to the value calculated dynamically instead of the user specified width value. Which then caused the anchoring math to get thrown off. Height probably suffered from the same bug, but it would only matter if you were not using dynamic height.

This fixes it by setting the width and height to user specified values. I've also updated the TextBox example script to make use of anchor_point and anchored_position which is what I used for testing the fix.

@FoamyGuy
Copy link
Contributor Author

This was tested successfully by 2 users who left comments in the linked issue. Merging, to get the fix in.

@FoamyGuy FoamyGuy merged commit 6d1d1b0 into adafruit:main May 28, 2025
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 29, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint to 2.2.21 from 2.2.20:
  > Merge pull request adafruit/Adafruit_CircuitPython_Fingerprint#57 from pantheraleo-7/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_OPT4048 to 1.0.3 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_OPT4048#3 from FoamyGuy/catch_crc_check_error
  > Merge pull request adafruit/Adafruit_CircuitPython_OPT4048#2 from FoamyGuy/ws_server_example

Updating https://github.com/adafruit/Adafruit_CircuitPython_OV2640 to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_OV2640#31 from FoamyGuy/displayio_api_updates

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1351 to 1.4.5 from 1.4.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1351#23 from FoamyGuy/displayio_api_updates

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 3.3.1 from 3.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#222 from FoamyGuy/fix_textbox_anchor_pos

Updating https://github.com/adafruit/Adafruit_CircuitPython_hashlib to 1.4.18 from 1.4.17:
  > Merge pull request adafruit/Adafruit_CircuitPython_hashlib#23 from adafruit/use_ruff

Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.8.5 from 1.8.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Slideshow#46 from FoamyGuy/displayio_api_updates

Updating https://github.com/adafruit/Adafruit_CircuitPython_turtle to 3.1.7 from 3.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_turtle#51 from FoamyGuy/displayio_api_update

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_SEN6x
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.

TextBox anchor_point/anchored_position Doesn't Work Properly
1 participant