summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-12-04 11:05:46 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-12-04 11:05:46 -0500
commitc2d51783d5b9f17b4bbf624c33ba4ceb584aa4f5 (patch)
tree8be64d24d2ba9a6547b6040ca166e0e5620eecc1
parente0922bfbba791549c96e33a33e69f488bf5009fc (diff)
pke-editor: imgui PushID inside font type table
-rw-r--r--editor/editor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index d3363f6..c1be34b 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -1211,6 +1211,7 @@ void RecordImGuiPlayerInput() {
void RecordImGuiFont() {
pk_iter_t<FontType> iter_ft{};
bool b;
+ uint32_t c;
if (!ImGui::Begin("Fonts")) {
ImGui::End();
return;
@@ -1230,6 +1231,7 @@ void RecordImGuiFont() {
pk_bkt_arr_t<FontType> &fonts_base = *static_cast<pk_bkt_arr_t<FontType>*>(FontType_GetFonts());
if (ImGui::BeginTable("Font list", 3, tableFlags)) {
+ c = 0;
ImGui::TableSetupColumn("Title");
ImGui::TableSetupColumn("MSDF settings");
ImGui::TableSetupColumn("Spacing");
@@ -1238,10 +1240,12 @@ void RecordImGuiFont() {
while(b) {
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
+ ImGui::PushID(c);
if (ImGui::Button("select")) {
editor_mstr.rt.selected_font_type = (FontType*)iter_ft.data;
editor_mstr.rt.show_font_glyphs = true;
}
+ ImGui::PopID();
ImGui::SameLine();
ImGui::Text("Title: %s", iter_ft->title.val);
ImGui::TableSetColumnIndex(1);
@@ -1256,6 +1260,7 @@ void RecordImGuiFont() {
ImGui::Text("underline_y: %f", iter_ft->spacing.underline_y);
ImGui::Text("underline_thickness: %f", iter_ft->spacing.underline_thickness);
b = pk_bkt_arr_iter_increment(&fonts_base, &iter_ft);
+ ++c;
}
ImGui::EndTable();
}