1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:15:07 +00:00

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
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)