mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix undefined inf to s32 cast in GUIScrollBar::setPos
This commit is contained in:
parent
73e85b2ebb
commit
1bc74b0ba1
@ -266,8 +266,8 @@ void GUIScrollBar::setPos(const s32 &pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_auto_scaling)
|
if (is_auto_scaling)
|
||||||
thumb_size = s32(thumb_area /
|
thumb_size = (s32)std::fmin(S32_MAX,
|
||||||
(f32(page_size) / f32(thumb_area + border_size * 2)));
|
thumb_area / (f32(page_size) / f32(thumb_area + border_size * 2)));
|
||||||
|
|
||||||
thumb_size = core::s32_clamp(thumb_size, thumb_min, thumb_area);
|
thumb_size = core::s32_clamp(thumb_size, thumb_min, thumb_area);
|
||||||
scroll_pos = core::s32_clamp(pos, min_pos, max_pos);
|
scroll_pos = core::s32_clamp(pos, min_pos, max_pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user