From 3be094febce7e6154c8241b94b9819823710cf8f Mon Sep 17 00:00:00 2001 From: William JCM Date: Thu, 31 Mar 2022 17:58:37 +0200 Subject: [PATCH] ToastQueue: make toasts wrap instead of cutting them off. --- src/ToastQueue/ToastQueue.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ToastQueue/ToastQueue.cpp b/src/ToastQueue/ToastQueue.cpp index 52c80f1..d0902d7 100644 --- a/src/ToastQueue/ToastQueue.cpp +++ b/src/ToastQueue/ToastQueue.cpp @@ -142,12 +142,9 @@ void ToastQueue::draw(Vector2i viewport_size) { ImGui::SameLine(); } - if(current->message().size() > 127) { - ImGui::TextColored(colour, "%.*s...", 127, current->message().data()); - } - else { - ImGui::TextColored(colour, current->message().data()); - } + ImGui::PushTextWrapPos(500.0f); + ImGui::TextColored(colour, current->message().data()); + ImGui::PopTextWrapPos(); height += ImGui::GetWindowHeight() + toast_spacing; }