Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = mis
ignore-words-list = cleary,mis
check-filenames =
check-hidden =
skip = ./.git
39 changes: 34 additions & 5 deletions src/ArduinoGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,17 +448,21 @@ void ArduinoGraphics::endText(int scrollDirection)
uint8_t strokeG = _strokeG;
uint8_t strokeB = _strokeB;


stroke(_textR, _textG, _textB);

if (scrollDirection == SCROLL_LEFT) {
int scrollLength = _textBuffer.length() * textFontWidth() + _textX;

for (int i = 0; i < scrollLength; i++) {
beginDraw();

int const text_x = _textX - i;
stroke(_textR, _textG, _textB);
text(_textBuffer, text_x, _textY);
bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY);

// clear previous position
const int clearX = text_x + _textBuffer.length() * _font->width;
stroke(_backgroundR, _backgroundG, _backgroundB);
line(clearX, _textY, clearX, _textY + _font->height - 1);

endDraw();

delay(_textScrollSpeed);
Expand All @@ -468,9 +472,18 @@ void ArduinoGraphics::endText(int scrollDirection)

for (int i = 0; i < scrollLength; i++) {
beginDraw();

int const text_x = _textX - (scrollLength - i - 1);
stroke(_textR, _textG, _textB);
text(_textBuffer, text_x, _textY);

// clear previous position
const int clearX = text_x - 1;
stroke(_backgroundR, _backgroundG, _backgroundB);
line(clearX, _textY, clearX, _textY + _font->height - 1);

bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY);

endDraw();

delay(_textScrollSpeed);
Expand All @@ -480,9 +493,16 @@ void ArduinoGraphics::endText(int scrollDirection)

for (int i = 0; i < scrollLength; i++) {
beginDraw();

int const text_y = _textY - i;
stroke(_textR, _textG, _textB);
text(_textBuffer, _textX, text_y);
bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY);

// clear previous position
const int clearY = text_y + _font->height;
stroke(_backgroundR, _backgroundG, _backgroundB);
line(_textX, clearY, _textX + (_font->width * _textBuffer.length()) - 1, clearY);

endDraw();

delay(_textScrollSpeed);
Expand All @@ -492,15 +512,24 @@ void ArduinoGraphics::endText(int scrollDirection)

for (int i = 0; i < scrollLength; i++) {
beginDraw();

int const text_y = _textY - (scrollLength - i - 1);
stroke(_textR, _textG, _textB);
text(_textBuffer, _textX, text_y);

// clear previous position
const int clearY = text_y - 1;
stroke(_backgroundR, _backgroundG, _backgroundB);
line(_textX, clearY, _textX + (_font->width * _textBuffer.length()) - 1, clearY);

bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY);
endDraw();

delay(_textScrollSpeed);
}
} else {
beginDraw();
stroke(_textR, _textG, _textB);
text(_textBuffer, _textX, _textY);
endDraw();
}
Expand Down