From 33aefc005c27f49fedbf66faceef8b718d046bc7 Mon Sep 17 00:00:00 2001 From: Zaafar Date: Sat, 5 Dec 2020 13:51:02 -0500 Subject: [PATCH] bug fix: correctly calculating String start/end. --- src/ImGui.NET/ImGui.Manual.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImGui.NET/ImGui.Manual.cs b/src/ImGui.NET/ImGui.Manual.cs index 8b7ba52..ac6dd8b 100644 --- a/src/ImGui.NET/ImGui.Manual.cs +++ b/src/ImGui.NET/ImGui.Manual.cs @@ -384,7 +384,7 @@ namespace ImGuiNET int nativeTextOffset = Util.GetUtf8(text, nativeText, textByteCount); nativeText[nativeTextOffset] = 0; nativeTextStart = nativeText + (start.HasValue ? (start.Value * textByteSize) : 0); - nativeTextEnd = length.HasValue ? nativeTextStart + (length.Value + textByteSize) : null; + nativeTextEnd = length.HasValue ? nativeTextStart + (length.Value * textByteSize) : null; } ImGuiNative.igCalcTextSize(&ret, nativeTextStart, nativeTextEnd, *((byte*)(&hideTextAfterDoubleHash)), wrapWidth);