Skip to content

Commit

Permalink
fix section box offset when scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Nov 21, 2024
1 parent dfa1ed6 commit 32e644e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3280,6 +3280,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView)
s_ScrollRegion.Begin(&MainView, &ScrollOffset, &ScrollParams);

static std::vector<CUIRect> s_SectionBoxes;
static vec2 s_ScrollOffset(0.0f, 0.0f);

MainView.y += ScrollOffset.y;

Expand All @@ -3294,9 +3295,11 @@ void CMenus::RenderSettingsTClient(CUIRect MainView)
Section.h += MarginSmall;
Section.x -= MarginSmall;
//Section.y -= MarginExtraSmall * 0.5;
Section.y -= s_ScrollOffset.y - ScrollOffset.y;
float Shade = 0.0f;
Section.Draw(ColorRGBA(Shade, Shade, Shade, 0.25f), IGraphics::CORNER_ALL, 10.0f);
}
s_ScrollOffset = ScrollOffset;
s_SectionBoxes.clear();

// ***** LeftView ***** //
Expand Down

0 comments on commit 32e644e

Please sign in to comment.