diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-27 22:43:00 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-27 22:43:00 +0000 |
| commit | a2eed42dec7cb76ad787eccaad6ffa800d945e24 (patch) | |
| tree | 040aa74423d7d3b61dcc8bd4011dab4718e11978 /src | |
| parent | e663879bebbb1a2cd5c85a1cbe892988bdcc73ed (diff) | |
Fix drift in RMS smoothing; plot the centre of the window at its point, rather than the end.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/audio_plot.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 9b2e6b1b0..2098adb40 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -227,8 +227,9 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel) const } p = sqrt (p / smoothing.size ()); - - path.AddLineToPoint (_db_label_width + i * _x_scale, y_for_linear (p)); + + int const ind = max (0, i - int(smoothing.size() / 2)); + path.AddLineToPoint (_db_label_width + ind * _x_scale, y_for_linear (p)); } } |
