From 48c2b9c931c2a50f6c174b711c79fa33eacf410c Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Mon, 16 Aug 2021 14:34:46 +0100 Subject: [PATCH] Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index c32dc13..0570079 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -807,8 +807,11 @@ void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, if ( x_coord < 0 || y_coord < 0 || l < 1 || x_coord >= PIXELS_PER_ROW || y_coord >= m_cfg.mx_height) return; - if (x_coord+l > PIXELS_PER_ROW) - l = PIXELS_PER_ROW - x_coord + 1; // reset width to end of row + + l = ( (x_coord + l) >= PIXELS_PER_ROW ) ? (PIXELS_PER_ROW - x_coord):l; + + //if (x_coord+l > PIXELS_PER_ROW) +// l = PIXELS_PER_ROW - x_coord + 1; // reset width to end of row /* LED Brightness Compensation */ #ifndef NO_CIE1931