Skip to content

Commit

Permalink
Adjust slider handle size
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Aug 9, 2024
1 parent 00586a0 commit d339398
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/game/client/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,9 +1329,15 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
pRect->HMargin(5.0f, &Rail);

CUIRect Handle;
Rail.VSplitLeft(pColorInner ? 8.0f : clamp(33.0f, Rail.h, Rail.w / 3.0f), &Handle, 0);
Rail.VSplitLeft(pColorInner ? 8.0f : clamp(33.0f, Rail.h, Rail.w / 3.25f), &Handle, 0);
Handle.x += (Rail.w - Handle.w) * Current;

if(!pColorInner)
{
Handle.h += 4.0f;
Handle.y -= 2.0f;
}

// logic
const bool InsideRail = MouseHovered(&Rail);
const bool InsideHandle = MouseHovered(&Handle);
Expand Down

0 comments on commit d339398

Please sign in to comment.