sparkfun / SparkFun_Qwiic_OLED_Arduino_Library

Arduino Library for SparkFun's OLED Qwiic (I²C) boards
https://docs.sparkfun.com/SparkFun_Qwiic_OLED_Arduino_Library/introduction/
Other
9 stars 7 forks source link

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

Closed mikelowe983 closed 6 months ago

mikelowe983 commented 6 months ago

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