[msvc] Fix problem using invalid min/max bounds in std::clamp

There is an assert() in the std::clamp() impl on MSVC that checks if
the min/max values are valid.
This commit is contained in:
David Capello 2022-06-28 14:01:27 -03:00
parent b7d5d4a2c9
commit 6d30f274f4

View File

@ -4253,7 +4253,10 @@ void Timeline::setLayerCollapsedFlag(const layer_t l, const bool state)
int Timeline::separatorX() const
{
return std::clamp(m_separator_x, headerBoxWidth(), bounds().w-guiscale());
return std::clamp(m_separator_x,
headerBoxWidth(),
std::max(bounds().w-guiscale(),
headerBoxWidth()));
}
void Timeline::setSeparatorX(int newValue)