mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #4448
4448: Increase scrollbar handle size for small scrollbars r=def- a=Robyt3 The maximum scrollbar handle size was too small for small scrollbars. AFAIK, the previous size did not directly affect ddnet client, as there are no scrollbars that small, but they might be used eventually. See screenshots in https://github.com/teeworlds/teeworlds/pull/2995. ## Checklist - [X] Tested the change ingame - [X] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [X] Considered possible null pointers and out of bounds array indexing - [X] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
This commit is contained in:
commit
a818b4573e
|
@ -52,7 +52,7 @@ float CUIEx::DoScrollbarV(const void *pID, const CUIRect *pRect, float Current)
|
||||||
pRect->Margin(5.0f, &Rail);
|
pRect->Margin(5.0f, &Rail);
|
||||||
|
|
||||||
CUIRect Handle;
|
CUIRect Handle;
|
||||||
Rail.HSplitTop(clamp(33.0f, Rail.w, Rail.h / 8.0f), &Handle, 0);
|
Rail.HSplitTop(clamp(33.0f, Rail.w, Rail.h / 3.0f), &Handle, 0);
|
||||||
Handle.y = Rail.y + (Rail.h - Handle.h) * Current;
|
Handle.y = Rail.y + (Rail.h - Handle.h) * Current;
|
||||||
|
|
||||||
// logic
|
// logic
|
||||||
|
@ -132,7 +132,7 @@ float CUIEx::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current,
|
||||||
pRect->HMargin(5.0f, &Rail);
|
pRect->HMargin(5.0f, &Rail);
|
||||||
|
|
||||||
CUIRect Handle;
|
CUIRect Handle;
|
||||||
Rail.VSplitLeft(pColorInner ? 8.0f : clamp(33.0f, Rail.h, Rail.w / 8.0f), &Handle, 0);
|
Rail.VSplitLeft(pColorInner ? 8.0f : clamp(33.0f, Rail.h, Rail.w / 3.0f), &Handle, 0);
|
||||||
Handle.x += (Rail.w - Handle.w) * Current;
|
Handle.x += (Rail.w - Handle.w) * Current;
|
||||||
|
|
||||||
// logic
|
// logic
|
||||||
|
|
Loading…
Reference in a new issue