Skip to content

Fix issue with drawing bitmaps of certain heights at non-zero y0 values #18

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

Conversation

mikelowe983
Copy link
Contributor

There was a minor logic error within QwGrSSD1306::drawBitmap function which caused bitmaps of some heights to drop pixel rows. This was due to an incorrect left-shift value when remainingBits was greater than 0.

To resolve, we derive the left-shift value using:

(neededBits - remainingBits)

rather than:

(kByteNBits - remainingBits)

This handles scenarios where there is less than one bytes worth of bitmap data remaining past the "straddle point"

Resolves #17

Copy link
Member

@gigapod gigapod left a comment

Choose a reason for hiding this comment

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

Perfect.

@gigapod gigapod merged commit 3d58c20 into sparkfun:main Mar 12, 2024
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.

Bitmaps of certain heights don't draw correctly at non-zero y values
2 participants