Skip to content

Fix label background_color setter #137

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 2 commits into from
Mar 11, 2021

Conversation

FoamyGuy
Copy link
Contributor

This resolves #136

Setting the background_color previously worked differently in BitmapLabel vs. Label. They were inadvertently combined during the refactor to behave the same which caused trouble for Label.

These changes break it out into separate implementations so that each can have their own correctly working behavior.

I tested with:

Adafruit CircuitPython 6.2.0-beta.3-36-g103632f44 on 2021-03-07; Adafruit PyPortal with samd51j20

using the code from the error as well as a few other background color example scripts from this repo. Everything seems to be working okay with this changes. @jposada202020 if you have a chance to try it out let me know if you still see any issues.

@jposada202020
Copy link
Contributor

@FoamyGuy I will test this afternoon.

@jposada202020
Copy link
Contributor

@FoamyGuy I did my tests, I create a test code, that hopefully will help us in the future, maybe we can add it to the library repo somehow.
Thanks, for the fix works for the background very well, as I was trying to see other problems. I did different tests just to be sure.
I found the following problems:
We have some error is the setter of anchor point, I tested with the old code too and at some point we introduce this. I put a try, except in the testing code to catch this.
When using bitmap_label, and setting the anchor_position, and position the logic is doing something not as expected. you can see it in the test.
Not sure if the problem when these problems where introduced. I can take a look, after. As I did not use this library in the past, I am not sure how people were setting-up the anchor point

There is a time hard coded in the test. I recommend to use a time between 3 and 5.
Test_code is in https://github.com/jposada202020/sandbox_display_text/blob/master/testing_issue_background.py
I used this font. It is just the same font that we use but smaller and is in here. https://github.com/jposada202020/sandbox_display_text/blob/master/LibreBodoniv2002-Bold-10.bdf

@FoamyGuy
Copy link
Contributor Author

Thanks for testing this out @jposada202020 and confirming the background fix. I'm going to go ahead and merge this one and make a new issue and new PR fix for the anchored_position when it's ready

@FoamyGuy FoamyGuy merged commit 5934db7 into adafruit:master Mar 11, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 12, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.9.0 from 2.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#47 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#46 from FoamyGuy/pylint_to_precommit

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1675 to 1.1.5 from 1.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1675#9 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.5 from 2.15.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#137 from FoamyGuy/fix_label_background_setter
@FoamyGuy FoamyGuy mentioned this pull request Mar 13, 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.

When using background setter, background text does not show correctly
2 participants