Invert each second row

This commit is contained in:
C3MA
2018-01-12 20:50:51 +01:00
parent 78a9027ad7
commit f51613255b
3 changed files with 7 additions and 3 deletions

View File

@@ -184,6 +184,10 @@ public class WS2812Layout extends JFrame {
if (mElements != null) {
int i = (index / mColumn);
int j = (index % mColumn);
// Swap each second row
if (i % 2 == 1) {
j = (mColumn-1) - j;
}
if ((i < mElements.length) && (j < mElements[i].length) && (mElements[i][j] != null)) {
Element curlbl = mElements[i][j];
curlbl.setColor(r, g, b);