1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 22:01:45 -05:00

GLScope: fixed trace modulo setup

This commit is contained in:
f4exb 2019-10-16 18:02:28 +02:00
parent 8126cbeb5c
commit b18d81e16b

View File

@ -1978,7 +1978,8 @@ void GLScope::setColorPalette(int nbVertices, int modulo, GLfloat *colors)
for (int v = 0; v < nbVertices; v++) for (int v = 0; v < nbVertices; v++)
{ {
int ci = modulo < 2 ? v : v % modulo; int ci = modulo < 2 ? v : v % modulo;
float x = 0.8f*(((float) ci)/modulo); int nbColors = modulo < 2 ? nbVertices : modulo;
float x = 0.8f*(((float) ci)/nbColors);
QColor c = QColor::fromHslF(x, 0.8f, 0.6f); QColor c = QColor::fromHslF(x, 0.8f, 0.6f);
colors[3*v] = c.redF(); colors[3*v] = c.redF();
colors[3*v+1] = c.greenF(); colors[3*v+1] = c.greenF();