diff options
| author | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-06-09 10:15:49 +0100 |
|---|---|---|
| committer | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-06-09 10:15:49 +0100 |
| commit | 5ffb913d5682a35d948866d6451bf5eb8e80a7d0 (patch) | |
| tree | 2a585469ea77fdb38119157470b9e6528164242e | |
| parent | a2d8ffea9e8aa60d33972f416028bc02a7bd15e0 (diff) | |
Update ESP32-VirtualMatrixPanel-I2S-DMA.h
| -rw-r--r-- | ESP32-VirtualMatrixPanel-I2S-DMA.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ESP32-VirtualMatrixPanel-I2S-DMA.h b/ESP32-VirtualMatrixPanel-I2S-DMA.h index eba4e95..32bb8a1 100644 --- a/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -107,7 +107,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t x, int16_t y) { coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer - if (x < 0 || x > width() || y < 0 || y > height() ) { + if (x < 0 || x >= width() || y < 0 || y >= height() ) { //Serial.printf("VirtualMatrixPanel::getCoords(): Invalid virtual display coordinate. x,y: %d, %d\r\n", x, y); return coords; } @@ -127,7 +127,8 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t x, int16_t y) { { // First portion gets you to the correct offset for the row you need // Second portion inverts the x on the row - coords.x = (y / panelResY) * (module_cols * panelResX) + (virtualResX - 1 - x); + //coords.x = (y / panelResY) * (module_cols * panelResX) + (virtualResX - 1 - x); + coords.x = (y / panelResY) * (module_cols * panelResX) + (virtualResX - 0 - x); // hack untested 9/june/21 // inverts the y the row coords.y = panelResY - 1 - (y % panelResY); |
