Skip to content

Commit

Permalink
Enhance Slider Handles
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Apr 25, 2024
1 parent 7cfadf6 commit a4b5799
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game/client/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1215,9 +1215,14 @@ 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.5f), &Handle, 0);
Handle.x += (Rail.w - Handle.w) * Current;

if(!pColorInner)
{
Handle.h += 4.0f;
Handle.y -= 2.0f;
}
// logic
static float s_OffsetX;
const bool InsideRail = MouseHovered(&Rail);
Expand Down

0 comments on commit a4b5799

Please sign in to comment.