mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
prwevent scroll-driven zoom in pianoroll from exceeding a reasonable level
This commit is contained in:
parent
85b637878d
commit
1ae5ea0e92
1 changed files with 7 additions and 0 deletions
|
|
@ -2498,6 +2498,13 @@ EditingContext::reset_y_origin (double y)
|
|||
void
|
||||
EditingContext::reset_zoom (samplecnt_t spp)
|
||||
{
|
||||
std::pair<timepos_t, timepos_t> ext = max_zoom_extent();
|
||||
samplecnt_t max_extents_pp = (ext.second.samples() - ext.first.samples()) / _visible_canvas_width;
|
||||
|
||||
if (spp > max_extents_pp) {
|
||||
spp = max_extents_pp;
|
||||
}
|
||||
|
||||
if (spp == samples_per_pixel) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue