Skip to content
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

Fix: Clear up artefacts after when using scrolling text. #36

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

aentinger
Copy link
Contributor

This fixes #27.

The following test-code was used to reproduce the problem and confirm its fix on a Arduino Uno R4 WiFi:

#include <ArduinoGraphics.h>
#include <Arduino_LED_Matrix.h>

ArduinoLEDMatrix matrix;

void setup() {
  matrix.begin();
  matrix.textScrollSpeed(100);
  matrix.textFont(Font_5x7);

  matrix.beginText(matrix.width(), 1, 80, 80, 80);
  matrix.print("H");
  matrix.endText(SCROLL_RIGHT);

  matrix.beginText(matrix.width(), 1, 80, 80, 80);
  matrix.print("H");
  matrix.endText(SCROLL_LEFT);

  matrix.beginText(matrix.width() / 2, matrix.height(), 80, 80, 80);
  matrix.print("H");
  matrix.endText(SCROLL_UP);

  matrix.beginText(matrix.width() / 2, matrix.height(), 80, 80, 80);
  matrix.print("H");
  matrix.endText(SCROLL_DOWN);
}

void loop() {}

w/ the changes contained in this PR this is the actual output on the LED matrix:

VID_20240110_085601.mp4

Note: the reason this issue only appeary when scrolling right (SCROLL_RIGHT) or down (SCROLL_DOWN) is based on the internal implementation of fonts. They are stored as a bitmap and both bottom row and right-most column are always 0, hence a auto-cleaning of artefacts takes place. In case this behaviour should change in the future with adding fonts that contain 1s in the bottom row or right-most column the appropriate artefact-cleaning implementation has already been implemented in this PR.

@aentinger aentinger added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jan 10, 2024
@aentinger aentinger self-assigned this Jan 10, 2024
@aentinger aentinger requested a review from per1234 January 10, 2024 08:29
@aentinger aentinger merged commit b8b2c9b into master Jan 11, 2024
7 of 11 checks passed
@aentinger aentinger deleted the fix-27 branch January 11, 2024 05:47
@per1234 per1234 added type: imperfection Perceived defect in any part of project and removed type: enhancement Proposed improvement labels Jan 12, 2024
aentinger added a commit to arduino/ArduinoCore-renesas that referenced this pull request Feb 14, 2024
This fixes #259.

Instead the root cause for this issue was within ArduinoGraphics, for a detailed explanation see here: arduino-libraries/ArduinoGraphics#36 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

endText: SCROLL_RIGHT and SCROLL_DOWN "traces"
2 participants