Skip to content

Commit

Permalink
Fix undefined inf to s32 cast in GUIScrollBar::setPos
Browse files Browse the repository at this point in the history
  • Loading branch information
Desour authored and sfan5 committed Nov 19, 2023
1 parent 73e85b2 commit 1bc74b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/guiScrollBar.cpp
Expand Up @@ -266,8 +266,8 @@ void GUIScrollBar::setPos(const s32 &pos)
}

if (is_auto_scaling)
thumb_size = s32(thumb_area /
(f32(page_size) / f32(thumb_area + border_size * 2)));
thumb_size = (s32)std::fmin(S32_MAX,
thumb_area / (f32(page_size) / f32(thumb_area + border_size * 2)));

thumb_size = core::s32_clamp(thumb_size, thumb_min, thumb_area);
scroll_pos = core::s32_clamp(pos, min_pos, max_pos);
Expand Down

0 comments on commit 1bc74b0

Please sign in to comment.