diff --git a/Editor/src/UI/widgets.h b/Editor/src/UI/widgets.h index e7ccddc..9e6ddfe 100644 --- a/Editor/src/UI/widgets.h +++ b/Editor/src/UI/widgets.h @@ -60,21 +60,24 @@ public: void ShowComponents(Entity& selected) { auto component = selected.GetComponent(); - char* buf = new char(component.name.size()); - strcpy(buf, component.name.c_str()); - ImGui::InputText("Name:", buf, sizeof(buf), ImGuiInputTextFlags_ReadOnly); + ImGui::InputText("Name:", (char*)component.name.c_str(), component.name.size() * sizeof(char), ImGuiInputTextFlags_ReadOnly); if (selected.HasComponent()) { auto& transform = selected.GetComponent(); if (ImGui::CollapsingHeader("Transform", ImGuiTreeNodeFlags_DefaultOpen)) { - ImGui::DragFloat3("Position", glm::value_ptr(transform.Position), 0.01f); - ImGui::DragFloat3("Rotation", glm::value_ptr(transform.Rotation), 0.01f); - ImGui::DragFloat3("Scale", glm::value_ptr(transform.Scale), 0.01f, 0.0f); + ImGui::DragFloat3("Position", glm::value_ptr(transform.Position), 0.1f); + ImGui::DragFloat3("Rotation", glm::value_ptr(transform.Rotation), 0.1f); + ImGui::DragFloat3("Scale", glm::value_ptr(transform.Scale), 0.1f, 0.0f); + } + if (selected.HasComponent()) { + ImGui::Text("Has relation"); } + } + if (selected.HasComponent()) { auto& render3d = selected.GetComponent(); if (ImGui::CollapsingHeader("Render3D", ImGuiTreeNodeFlags_DefaultOpen)) {