diff options
| author | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-10-11 17:43:46 +0100 |
|---|---|---|
| committer | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-10-11 17:43:46 +0100 |
| commit | cf66382d75d5fb9b9a6f890d0d92c5d09c0fbc96 (patch) | |
| tree | 051e090ecbecb1b9000dcf515c56285eb705794b /examples | |
| parent | 15cd0a756305611d7a481005d3c3c32481cbac9f (diff) | |
Update OneEighthScanMatrixPanel.h
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/One_Eighth_1_8_ScanPanel/OneEighthScanMatrixPanel.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/One_Eighth_1_8_ScanPanel/OneEighthScanMatrixPanel.h b/examples/One_Eighth_1_8_ScanPanel/OneEighthScanMatrixPanel.h index 4bc9460..ec3150f 100644 --- a/examples/One_Eighth_1_8_ScanPanel/OneEighthScanMatrixPanel.h +++ b/examples/One_Eighth_1_8_ScanPanel/OneEighthScanMatrixPanel.h @@ -153,12 +153,18 @@ inline VirtualCoords OneEighthMatrixPanel::getCoords(int16_t x, int16_t y) { // 1/8 Scan Panel - Is the final x-coord on the 1st or 3rd, 1/4ths (8 pixel 'blocks') of the panel (i.e. Row 0-7 or 17-24) ? // Double the length of the x-coord if required if ( ((coords.y /8) % 2) == 0) { // returns true/1 for the 1st and 3rd 8-pixel 1/4th of a 32px high panel - coords.x += (panelResX*col); + coords.x += (panelResX); } // Half the y coord. coords.y = (y % 8); if ( y >= panelResY/2 ) coords.y +=8; + + // Push all the pixels across a bit more if we're on another column or row + if (row*col > 1) + { + coords.x += ((panelResX)*2*(col*row))-1; + } /* * END: 1/8 Scan Panel Pixel Re-Mapping |
