Skip to content

Commit 103f756

Browse files
authored
Merge pull request #75 from squix78/fix-black-string-drawing
Fix internal black drawing
2 parents 841aaad + f42857c commit 103f756

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OLEDDisplay.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,13 +728,13 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt
728728
if (yOffset >= 0) {
729729
switch (this->color) {
730730
case WHITE: buffer[dataPos] |= currentByte << yOffset; break;
731-
case BLACK: buffer[dataPos] &= currentByte << yOffset; break;
731+
case BLACK: buffer[dataPos] &= ~(currentByte << yOffset); break;
732732
case INVERSE: buffer[dataPos] ^= currentByte << yOffset; break;
733733
}
734734
if (dataPos < (DISPLAY_BUFFER_SIZE - DISPLAY_WIDTH)) {
735735
switch (this->color) {
736736
case WHITE: buffer[dataPos + DISPLAY_WIDTH] |= currentByte >> (8 - yOffset); break;
737-
case BLACK: buffer[dataPos + DISPLAY_WIDTH] &= currentByte >> (8 - yOffset); break;
737+
case BLACK: buffer[dataPos + DISPLAY_WIDTH] &= ~(currentByte >> (8 - yOffset)); break;
738738
case INVERSE: buffer[dataPos + DISPLAY_WIDTH] ^= currentByte >> (8 - yOffset); break;
739739
}
740740
}
@@ -744,7 +744,7 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt
744744

745745
switch (this->color) {
746746
case WHITE: buffer[dataPos] |= currentByte >> yOffset; break;
747-
case BLACK: buffer[dataPos] &= currentByte >> yOffset; break;
747+
case BLACK: buffer[dataPos] &= ~(currentByte >> yOffset); break;
748748
case INVERSE: buffer[dataPos] ^= currentByte >> yOffset; break;
749749
}
750750

0 commit comments

Comments
 (0)