From f42857c4d79dccb751b6ddba716e673986164f4d Mon Sep 17 00:00:00 2001 From: Fabrice Weinberg <Fabrice@weinberg.me> Date: Tue, 2 Aug 2016 16:15:33 +0200 Subject: [PATCH] Fix internal black drawing --- OLEDDisplay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OLEDDisplay.cpp b/OLEDDisplay.cpp index 0dd4ba6..f8fc226 100644 --- a/OLEDDisplay.cpp +++ b/OLEDDisplay.cpp @@ -728,13 +728,13 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt if (yOffset >= 0) { switch (this->color) { case WHITE: buffer[dataPos] |= currentByte << yOffset; break; - case BLACK: buffer[dataPos] &= currentByte << yOffset; break; + case BLACK: buffer[dataPos] &= ~(currentByte << yOffset); break; case INVERSE: buffer[dataPos] ^= currentByte << yOffset; break; } if (dataPos < (DISPLAY_BUFFER_SIZE - DISPLAY_WIDTH)) { switch (this->color) { case WHITE: buffer[dataPos + DISPLAY_WIDTH] |= currentByte >> (8 - yOffset); break; - case BLACK: buffer[dataPos + DISPLAY_WIDTH] &= currentByte >> (8 - yOffset); break; + case BLACK: buffer[dataPos + DISPLAY_WIDTH] &= ~(currentByte >> (8 - yOffset)); break; case INVERSE: buffer[dataPos + DISPLAY_WIDTH] ^= currentByte >> (8 - yOffset); break; } } @@ -744,7 +744,7 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt switch (this->color) { case WHITE: buffer[dataPos] |= currentByte >> yOffset; break; - case BLACK: buffer[dataPos] &= currentByte >> yOffset; break; + case BLACK: buffer[dataPos] &= ~(currentByte >> yOffset); break; case INVERSE: buffer[dataPos] ^= currentByte >> yOffset; break; } -- GitLab