update selectable label name editor

This commit is contained in:
scawful
2024-07-14 14:30:27 -04:00
parent 71b9f06a08
commit 22fce43423

View File

@@ -111,10 +111,10 @@ void ResourceLabelManager::SelectableLabelWithNameEdit(
} }
if (ImGui::BeginPopupContextItem(label_id.c_str())) { if (ImGui::BeginPopupContextItem(label_id.c_str())) {
char* new_label = labels_[type][key].data(); std::string* new_label = &labels_[type][key];
if (ImGui::InputText("##Label", new_label, labels_[type][key].size() + 1, if (ImGui::InputText("##Label", new_label,
ImGuiInputTextFlags_EnterReturnsTrue)) { ImGuiInputTextFlags_EnterReturnsTrue)) {
labels_[type][key] = new_label; labels_[type][key] = *new_label;
} }
ImGui::EndPopup(); ImGui::EndPopup();
} }