From 41da5dbd53070c614b1e32ffe49d0b8c16c49c30 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 12 Mar 2020 12:06:13 +1100 Subject: [PATCH] timebasedwidget: added comment explaining scrollbar re-adjustment --- app/widget/timebased/timebased.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/widget/timebased/timebased.cpp b/app/widget/timebased/timebased.cpp index dfa31c908..a23b1701f 100644 --- a/app/widget/timebased/timebased.cpp +++ b/app/widget/timebased/timebased.cpp @@ -83,6 +83,9 @@ void TimeBasedWidget::ScrollBarResized(const double &multiplier) { QScrollBar* bar = static_cast(sender()); + // Our extension area (represented by a TimelineViewEndItem) is NOT scaled, but the ResizableScrollBar doesn't know + // this. Here we re-calculate the requested scale knowing that the end item is not affected by scale. + int current_max = bar->maximum(); double proposed_max = static_cast(current_max) * multiplier;