LibGUI: Use clamp() is various places

This commit is contained in:
Andreas Kling 2020-01-20 13:16:58 +01:00
parent b52d0afecf
commit b25210ee1b
Notes: sideshowbarker 2024-07-19 09:56:34 +09:00
4 changed files with 7 additions and 29 deletions

View file

@ -53,10 +53,7 @@ void GProgressBar::set_range(int min, int max)
ASSERT(min < max);
m_min = min;
m_max = max;
if (m_value > m_max)
m_value = m_max;
if (m_value < m_min)
m_value = m_min;
m_value = clamp(m_value, m_min, m_max);
}
void GProgressBar::paint_event(GPaintEvent& event)