fix: ID collision when having duplicate fonts installed

Fixes #2141
This commit is contained in:
WerWolv 2025-02-25 11:52:46 +01:00
parent 51547dc941
commit cae0f772d5
1 changed files with 5 additions and 0 deletions

View File

@ -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();