nausea

curses audio visualizer
git clone git://git.2f30.org/nausea
Log | Files | Refs | README | LICENSE

commit 0803e2e7742db9253620dffb3acfd53c24f45725
parent 8f6321c741743ae9c2ec046cd8f0fe49e79aafa2
Author: sin <sin@2f30.org>
Date:   Mon, 18 Nov 2013 16:11:16 +0000

Only scale colors if color support is enabled

Diffstat:
Mspectrum.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/spectrum.c b/spectrum.c @@ -147,11 +147,13 @@ draw(struct frame *fr) unsigned freqs_per_col; struct color_range *cr; - /* scale color ranges */ - for (i = 0; i < LEN(color_ranges); i++) { - cr = &color_ranges[i]; - cr->scaled_min = cr->min * LINES / 100; - cr->scaled_max = cr->max * LINES / 100; + if (colors) { + /* scale color ranges */ + for (i = 0; i < LEN(color_ranges); i++) { + cr = &color_ranges[i]; + cr->scaled_min = cr->min * LINES / 100; + cr->scaled_max = cr->max * LINES / 100; + } } /* read dimensions to catch window resize */