From 4d0617aff71d25dc7664c57e6c871089cea83c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sat, 13 Apr 2024 23:45:04 +0200 Subject: [PATCH] Fixed text box losing the last letter --- GlitchyEditor/src/EditWindows/ComponentEditWindow.bf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf b/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf index ff717da..0b4f0ea 100644 --- a/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf +++ b/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf @@ -502,7 +502,7 @@ namespace GlitchyEditor.EditWindows text?.EnsureNullTerminator(); - if (ImGui.InputTextMultiline("##text", text.Ptr, (uint64)text.Length, .Zero, .CallbackResize, => InputTextCallback, Internal.UnsafeCastToPtr(text))) + if (ImGui.InputTextMultiline("##text", text.CStr(), (uint64)(text.Length + 1), .Zero, .CallbackResize, => InputTextCallback, Internal.UnsafeCastToPtr(text))) { // To deleting text, ImGui simply puts a null char after the remaining text. // Search for null char and set the length of the string accordingly.