mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-17 19:06:01 +01:00
Fix rec-ruler time display
The calculation to round the distance to seconds has to be performed using floating point maths, not just the result being cast to double. The time-granularity must not be zero.
This commit is contained in:
parent
a9192266d0
commit
a7ce58b995
1 changed files with 1 additions and 1 deletions
|
|
@ -1591,7 +1591,7 @@ RecorderUI::RecRuler::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rec
|
|||
|
||||
const int n_labels = floor (width / (_time_width * 1.75));
|
||||
const samplecnt_t time_span = _right - _left;
|
||||
const samplecnt_t time_granularity = ceil ((double)(time_span / n_labels / _session->sample_rate ())) * _session->sample_rate ();
|
||||
const samplecnt_t time_granularity = ceil ((double)time_span / n_labels / _session->sample_rate ()) * _session->sample_rate ();
|
||||
const double px_per_sample = width / (double) time_span;
|
||||
|
||||
const samplepos_t lower = (_left / time_granularity) * time_granularity;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue