-
-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
When using ArduinoGraphics on the Led Matrix and doing a scroll left random bits are showing in the RIGHT columns. This is happening as well when doing a scroll up, on the bottom lines.
It was noticed already doing development given the remark in the function endDraw()
in Arduino_LED_matrix.h
:
// clear first line (no idea why it gets filled with random bits, probably some math not working fine for super small displays) |
The root cause is related to ArduinoGraphics as it returns NEGATIVE numbers when scrolling. In the function set()
in Arduino_led_matrix.h
it checks for out of bound values, BUT not for negative values for Y and X. Then when doing a _canvasBuffer[y][x]
will cause under desired memory to be written.
Solution :
change in function set()
, line 251 from:
if (y >= canvasHeight || x >= canvasWidth) { |
to:
if (y >= canvasHeight || x >= canvasWidth || y < 0 || x < 0) {
Metadata
Metadata
Assignees
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project