Fix incorrect virtual Y coordinate for second and next rows of panels

This commit is contained in:
board707 2024-06-18 00:59:44 +03:00
parent 228e742702
commit 459516b6db

View file

@ -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
}
@ -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
}