diff --git a/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.Methods.cs b/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.Methods.cs index 0d6bf18..0f687c8 100644 --- a/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.Methods.cs +++ b/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.Methods.cs @@ -87,13 +87,11 @@ public void TextSameLine(ReadOnlySpan fmt) [MethodImpl(MethodImplOptions.AggressiveInlining | AggressiveOptimization)] public void PadRight(int toAppend) { - fixed (byte* paddingPtr = _padding) - { - var offset = _padding.Length - toAppend; - var paddingPtrWithOffset = (byte*) Unsafe.Add(paddingPtr, offset); - igText(paddingPtrWithOffset); - SameLine(0, 0); - } + Span padding = stackalloc byte[toAppend + 1]; + padding.Fill((byte) ' '); + padding[toAppend] = 0; + Text(padding); + SameLine(0, 0); } public void TextSameLine(ref readonly byte fmt) { diff --git a/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.cs b/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.cs index 89abfdd..f816b7e 100644 --- a/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.cs +++ b/src/BUTR.CrashReport.Renderer.ImGui/ImGui/CmGui.cs @@ -9,7 +9,6 @@ internal partial class CmGui { private const MethodImplOptions AggressiveOptimization = (MethodImplOptions) 512; - private static readonly byte[] _padding = UnsafeHelper.ToUtf8Array(string.Empty.PadRight(64)); private static readonly Vector2 Zero2 = Vector2.Zero; private static readonly Vector3 Zero3 = Vector3.Zero; private static readonly Vector4 Zero4 = Vector4.Zero;