diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-10-01 00:32:25 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-10-10 21:15:37 +0200 |
| commit | 11230f6021726307f20f782ea286eda72e8adeff (patch) | |
| tree | d9594ac2385db5eaed80bed9ee7384c2edd6b2d1 /src/wx/audio_plot.cc | |
| parent | f4d228c3e7a66e23d8ba958f804f32f0b823ce18 (diff) | |
Stop drawing random stuff below the y axis.
Diffstat (limited to 'src/wx/audio_plot.cc')
| -rw-r--r-- | src/wx/audio_plot.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index a2f6ca917..b032b8b2c 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -290,7 +290,7 @@ AudioPlot::y_for_linear (float p, Metrics const & metrics) const p = 1e-4; } - return metrics.height - (linear_to_db(p) - _minimum) * metrics.y_scale - metrics.y_origin; + return std::min(static_cast<double>(metrics.height - metrics.y_pad), metrics.height - (linear_to_db(p) - _minimum) * metrics.y_scale - metrics.y_pad); } |
