-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why leave this in?
There was a problem hiding this comment.
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.
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] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 1.3.1 from 1.3.0: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#16 from makermelissa/bugfixes
Fixes #14. Also fixes a group full bug I found today.