From cae0f772d561afa740dfe5fe2f90110501a9a4ce Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 25 Feb 2025 11:52:46 +0100 Subject: [PATCH] fix: ID collision when having duplicate fonts installed Fixes #2141 --- plugins/fonts/source/font_settings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/fonts/source/font_settings.cpp b/plugins/fonts/source/font_settings.cpp index bf4b69dd0..2e0668548 100644 --- a/plugins/fonts/source/font_settings.cpp +++ b/plugins/fonts/source/font_settings.cpp @@ -37,13 +37,18 @@ namespace hex::fonts { }); } + u32 index = 0; for (const auto &[path, fontName] : hex::getFonts()) { + ImGui::PushID(index); if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) { m_path = path; m_pixelPerfectFont = false; changed = true; } ImGui::SetItemTooltip("%s", fontName.c_str()); + ImGui::PopID(); + + index += 1; } ImGui::EndCombo();