From b18d81e16bee14b7866998508c4efdace64bcc37 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 16 Oct 2019 18:02:28 +0200 Subject: [PATCH] GLScope: fixed trace modulo setup --- sdrgui/gui/glscope.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdrgui/gui/glscope.cpp b/sdrgui/gui/glscope.cpp index d185ec941..dc9230d28 100644 --- a/sdrgui/gui/glscope.cpp +++ b/sdrgui/gui/glscope.cpp @@ -1978,7 +1978,8 @@ void GLScope::setColorPalette(int nbVertices, int modulo, GLfloat *colors) for (int v = 0; v < nbVertices; v++) { 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); colors[3*v] = c.redF(); colors[3*v+1] = c.greenF();