From 433c2e220c09c649f7dd9aa261fd6800d16f442b Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:21:14 +0000 Subject: [PATCH] fix overlapping text in fs fixes #13 --- sphaira/source/ui/menus/filebrowser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphaira/source/ui/menus/filebrowser.cpp b/sphaira/source/ui/menus/filebrowser.cpp index 0ca0031..67cfcc8 100644 --- a/sphaira/source/ui/menus/filebrowser.cpp +++ b/sphaira/source/ui/menus/filebrowser.cpp @@ -773,7 +773,8 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) { } nvgSave(vg); - nvgScissor(vg, x + text_xoffset+65, y, w-(x+text_xoffset+65+50), h); + const auto txt_clip = std::min(GetY() + GetH(), y + h) - y; + nvgScissor(vg, x + text_xoffset+65, y, w-(x+text_xoffset+65+50), txt_clip); gfx::drawText(vg, x + text_xoffset+65, y + (h / 2.f), 20.f, e.name, NULL, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, theme->elements[text_id].colour); nvgRestore(vg);