1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-09 16:41:14 +02:00

Fix TrackPanel rectangle calculations...

... There was an incorrect click-to-resize area active when the last track was
partly scrolled off the bottom

This big predated 2.3.3. development
This commit is contained in:
Paul Licameli 2019-06-26 21:17:28 -04:00
parent 349b882911
commit 5cd77187ef

View File

@ -976,14 +976,17 @@ namespace {
const TrackPanelGroup::Refinement &children,
const TrackPanelGroup::Refinement::const_iterator iter)
{
const auto lowerBound = (divideX ? rect.GetLeft() : rect.GetTop());
const auto upperBound = (divideX ? rect.GetRight() : rect.GetBottom());
const auto next = iter + 1;
const auto end = children.end();
const auto nextCoord = ((next == end) ? upperBound : next->first - 1);
wxCoord nextCoord;
if (next == end)
nextCoord = std::max( iter->first,
divideX ? rect.GetRight() : rect.GetBottom() );
else
nextCoord = next->first - 1;
auto lesser = std::max(lowerBound, std::min(upperBound, iter->first));
auto greater = std::max(lesser, std::min(upperBound, nextCoord));
auto lesser = iter->first;
auto greater = nextCoord;
auto result = rect;
if (divideX)