From 39e317f36de6a728a86a0c3adedd127600786326 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 14 Jun 2021 23:51:41 +0200 Subject: [PATCH] Fix display of messages with newlines. --- server/TracyView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 6b4ee9a0..b74800ae 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -9454,10 +9454,12 @@ void View::DrawMessageLine( const MessageData& msg, bool hasCallstack, int& idx ImGui::SameLine(); ImGui::TextDisabled( "(%s)", RealToString( tid ) ); ImGui::TableNextColumn(); + auto tend = text; + while( *tend != '\0' && *tend != '\n' ) tend++; ImGui::PushStyleColor( ImGuiCol_Text, msg.color ); const auto cw = ImGui::GetContentRegionAvail().x; - const auto tw = ImGui::CalcTextSize( text ).x; - ImGui::TextUnformatted( text ); + const auto tw = ImGui::CalcTextSize( text, tend ).x; + ImGui::TextUnformatted( text, tend ); if( tw > cw && ImGui::IsItemHovered() ) { ImGui::SetNextWindowSize( ImVec2( 1000, 0 ) );