Skip to content
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

Added code to deal with zero width or height bitmaps #27

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

makermelissa
Copy link
Contributor

No description provided.

@makermelissa makermelissa requested a review from a team June 30, 2020 22:10
@makermelissa makermelissa merged commit 1715d92 into adafruit:master Jun 30, 2020
@@ -99,14 +99,18 @@ def __init__(
self._flip_y = False
self._top_left_x = 0
self._top_left_y = 0
if tile_width is None:
if tile_width is None or tile_width == 0:
Copy link
Member

Choose a reason for hiding this comment

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

if not tile_width: would cover both cases.

tile_height = bitmap_height
if tile_width > 0 and bitmap_width % tile_width != 0:
if tile_width < 1:
tile_width = 1
Copy link
Member

Choose a reason for hiding this comment

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

Let's raise an exception instead. 0 makes no sense and should therefore be invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should probably fix it in display_text first.

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.

None yet

3 participants