From f90049ff0790d5a7f6df5e031570039e60eabf9e Mon Sep 17 00:00:00 2001 From: Darby Payne Date: Thu, 23 Oct 2014 02:45:16 -0700 Subject: [PATCH] visualizer: ellipse is now closer to circular and the colors change faster --- src/visualizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visualizer.cpp b/src/visualizer.cpp index 76f19269..d879c89d 100644 --- a/src/visualizer.cpp +++ b/src/visualizer.cpp @@ -225,13 +225,13 @@ void Visualizer::DrawSoundWaveFillStereo(int16_t *buf_left, int16_t *buf_right, void Visualizer::DrawSoundEllipseStereo(int16_t *buf_left, int16_t *buf_right, ssize_t samples, size_t height) { const long width = w.getWidth()/2; - const long scaledRadius = std::max(pow(width,2), pow(height,2))/Config.visualizer_colors.size(); + const long scaledRadius = std::max(pow(width,2), pow(height,2))/pow(Config.visualizer_colors.size(),2); for (size_t i = 0; i < samples; ++i) { long x = width + ((double) buf_left[i] * 2 * ((double)width / 65536.0)); long y = height + ((double) buf_right[i] * 2 * ((double)height / 65536.0)); - w << toColor(pow(x - width, 2) + pow(y - ((long)height),2), scaledRadius) + w << toColor(pow((x - width)*1, 2) + pow((y - ((long)height)) * 2,2), scaledRadius) << NC::XY(x, y) << Config.visualizer_chars[1] << NC::Color::End;