From 22fce43423fb9fc0f8c3022423fe0167c3f2d9b1 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 14 Jul 2024 14:30:27 -0400 Subject: [PATCH] update selectable label name editor --- src/app/core/labeling.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/core/labeling.cc b/src/app/core/labeling.cc index de30023f..492dcfb7 100644 --- a/src/app/core/labeling.cc +++ b/src/app/core/labeling.cc @@ -111,10 +111,10 @@ void ResourceLabelManager::SelectableLabelWithNameEdit( } if (ImGui::BeginPopupContextItem(label_id.c_str())) { - char* new_label = labels_[type][key].data(); - if (ImGui::InputText("##Label", new_label, labels_[type][key].size() + 1, + std::string* new_label = &labels_[type][key]; + if (ImGui::InputText("##Label", new_label, ImGuiInputTextFlags_EnterReturnsTrue)) { - labels_[type][key] = new_label; + labels_[type][key] = *new_label; } ImGui::EndPopup(); }