Skip to content

Updates bitmap sizing and logic checks for adding/removing bitmap #3

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
Jul 8, 2020

Conversation

kmatch98
Copy link
Owner

@kmatch98 kmatch98 commented Jul 8, 2020

After merging @FoamyGuy latest changes, here are a couple of more edits to correct the bitmap sizing.

Also, I updated _update_text to call _update_background_color to reuse code.

I updated the boolean checks for the bitmap inserting/appending/deleting bitmaps at the end of _update_background_color to respond to zero-width and zero-height bitmap sizing.

@kmatch98
Copy link
Owner Author

kmatch98 commented Jul 8, 2020

@FoamyGuy I think I merged your changes and my udpates into here. Please review the changes and test.

I made these updates to resolve a couple of issues I observed in my testing:

  • Upon creating a text box, the bitmap would not get created on the initial loop.
  • When changing the text to '' there was still a bitmap showing.
  • There was an error calculating the bitmap width in the boolean checks. You had used len(text) this is # of characters, rather than self._boundingbox[2] this is the number of pixels for width.
  • I added another boolean check for the bitmap height > 0. With negative padding, this could be likely.
  • I made _update_text just call _update_background_color to prevent repeating code

@kmatch98
Copy link
Owner Author

kmatch98 commented Jul 8, 2020

I'm going to merge this PR and then we can make any further updates with another PR.

@kmatch98 kmatch98 merged commit ec98a7f into bitmap_zero Jul 8, 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.

1 participant