mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Consistent width for internal scrollbars of formspec elements (#14689)
also: Make sure that very short, wide scrollbars are still usable
This commit is contained in:
parent
6c0b8229ec
commit
d5fc040d2d
3 changed files with 4 additions and 4 deletions
|
@ -274,10 +274,10 @@ void GUIScrollBar::setPosRaw(const s32 &pos)
|
|||
s32 thumb_min = 0;
|
||||
|
||||
if (is_horizontal) {
|
||||
thumb_min = RelativeRect.getHeight();
|
||||
thumb_min = std::min(RelativeRect.getHeight(), RelativeRect.getWidth() / 2);
|
||||
thumb_area = RelativeRect.getWidth() - border_size * 2;
|
||||
} else {
|
||||
thumb_min = RelativeRect.getWidth();
|
||||
thumb_min = std::min(RelativeRect.getWidth(), RelativeRect.getHeight() / 2);
|
||||
thumb_area = RelativeRect.getHeight() - border_size * 2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue