Fix region-peak display for trimmed regions
This commit is contained in:
parent
5cd26221ce
commit
41c52882af
@ -87,12 +87,15 @@ RegionPeakCursor::set (AudioRegionView* arv, samplepos_t when, samplecnt_t sampl
|
|||||||
assert (ar);
|
assert (ar);
|
||||||
assert (ar->n_channels () > 0);
|
assert (ar->n_channels () > 0);
|
||||||
|
|
||||||
sampleoffset_t s = when + ar->start () - ar->position ();
|
sampleoffset_t s = when - ar->position ();
|
||||||
if (s < 0 || s > ar->length ()) {
|
if (s < 0 || s > ar->length ()) {
|
||||||
hide ();
|
hide ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* read_peaks() offset is relative to the region's source */
|
||||||
|
s += ar->start ();
|
||||||
|
|
||||||
PeakData p;
|
PeakData p;
|
||||||
for (uint32_t chn = 0; chn < ar->n_channels (); ++chn) {
|
for (uint32_t chn = 0; chn < ar->n_channels (); ++chn) {
|
||||||
PeakData pc;
|
PeakData pc;
|
||||||
|
Loading…
Reference in New Issue
Block a user