nausea

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

commit 22df4be986d0babfbe925e348b360f5441b39264
parent 89ad3e5be45f1591c9ea2d80f4988d1cfa5dbe31
Author: sin <sin@2f30.org>
Date:   Wed, 20 Nov 2013 12:16:43 +0000

Use fr->height instead of LINES directly

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

diff --git a/spectrum.c b/spectrum.c @@ -145,19 +145,19 @@ draw(struct frame *fr) unsigned freqs_per_col; struct color_range *cr; + /* read dimensions to catch window resize */ + fr->width = COLS; + fr->height = LINES; + 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; + cr->scaled_min = cr->min * fr->height / 100; + cr->scaled_max = cr->max * fr->height / 100; } } - /* read dimensions to catch window resize */ - fr->width = COLS; - fr->height = LINES; - /* take most of the left part of the band */ #define BANDCUT 0.5 freqs_per_col = (nsamples / 2) / fr->width * BANDCUT;