From d49e2736b6e5b1aacf520db3f7ca57890687f4fe Mon Sep 17 00:00:00 2001 From: Infi Date: Wed, 15 May 2024 23:06:51 +0200 Subject: [PATCH] Wrap emotes if space isn't enough --- ChatTwo/Ui/ChatLogWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs index 545e6bb..09fc872 100644 --- a/ChatTwo/Ui/ChatLogWindow.cs +++ b/ChatTwo/Ui/ChatLogWindow.cs @@ -1584,6 +1584,10 @@ public sealed class ChatLogWindow : Window var emoteSize = ImGui.CalcTextSize("W"); emoteSize = emoteSize with { Y = emoteSize.X } * 1.5f; + // TextWrap doesn't work for emotes, so we have to wrap them manually + if (ImGui.GetContentRegionAvail().X < emoteSize.X) + ImGui.NewLine(); + // We only draw a dummy if it is still loading, in the case it failed we draw the actual name var image = EmoteCache.GetEmote(emotePayload.Code); if (image is { Failed: false })