Skip to content

Bug fixes related to text #16

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 3 commits into from
Sep 8, 2020
Merged

Conversation

makermelissa
Copy link
Collaborator

Fixes #14. Also fixes a group full bug I found today.

@makermelissa makermelissa requested a review from a team September 8, 2020 17:34
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Just a few questions. Thanks!

# for i in range(len(self.splash)):
# if self.splash[i] == self._text[index]:
# text_index = i
# break
Copy link
Member

Choose a reason for hiding this comment

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

Why leave this in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I commented out for testing purposes, but I think it makes more sense to remove it than uncomment it.

Comment on lines 276 to 281
self._text[index] = Label(
self._text_font, text=string, max_glyphs=max_glyphs
)
self._text[index].color = self._text_color[index]
self._text[index].x = self._text_position[index][0]
self._text[index].y = self._text_position[index][1]
Copy link
Member

Choose a reason for hiding this comment

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

This looks identical to above. Could it be factored out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Possibly. I can take a look.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, took a look. It looks like the lines before and after this section are different. So while we could improve code reuse a tiny bit, I think the potential to introduce bugs from the if/else conditions changing midway during operations and reduced readability make it not worth refactoring.

@makermelissa makermelissa requested a review from tannewt September 8, 2020 19:28
@makermelissa makermelissa requested a review from tannewt September 8, 2020 21:04
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you! We should keep thinking on how to share this with PyPortal.

@tannewt tannewt merged commit f215ee3 into adafruit:master Sep 8, 2020
@makermelissa
Copy link
Collaborator Author

Yeah, it could be done for sure. A revamp of the PyPortal library would probably be good to break it up and there's a good chance we could do that without breaking anything. After that, sharing becomes more realistic.

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 9, 2020
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.

Setting text to an empty string results in errors
2 participants