Skip to content

Commit

Permalink
Fix incorrect virtual Y coordinate for second and next rows of panels
Browse files Browse the repository at this point in the history
  • Loading branch information
board707 committed Jun 17, 2024
1 parent 228e742 commit 459516b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ESP32-VirtualMatrixPanel-I2S-DMA.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t virt_x, int16_t virt_
as if the panel is 2 * W and 0.5 * H !
*/

if ((virt_y & 8) == 0)
if ((coords.y & 8) == 0)
{
coords.x += ((coords.x / panelResX) + 1) * panelResX; // 1st, 3rd 'block' of 8 rows of pixels, offset by panel width in DMA buffer
}
Expand All @@ -405,7 +405,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t virt_x, int16_t virt_
}
else if (panel_scan_rate == FOUR_SCAN_16PX_HIGH)
{
if ((virt_y & 4) == 0)
if ((coords.y & 4) == 0)
{
coords.x += ((coords.x / panelResX) + 1) * panelResX; // 1st, 3rd 'block' of 8 rows of pixels, offset by panel width in DMA buffer
}
Expand Down

0 comments on commit 459516b

Please sign in to comment.