From 89016454f8965b0e04b1406bb77cb4c936e0baf6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 15 Aug 2022 15:44:13 +0200 Subject: [PATCH] Progressively remove namespaces. --- server/TracyView_Utility.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/TracyView_Utility.cpp b/server/TracyView_Utility.cpp index f98a12c9..c4bc187c 100644 --- a/server/TracyView_Utility.cpp +++ b/server/TracyView_Utility.cpp @@ -925,7 +925,17 @@ const char* View::ShortenZoneName( const char* name, ImVec2& tsz, float zsz ) co tsz = ImGui::CalcTextSize( ptr, end ); if( tsz.x < zsz ) return ptr; - return ptr; + for(;;) + { + auto p = ptr; + while( p < end && *p != ':' ) p++; + if( p == end ) return ptr; + p++; + while( p < end && *p == ':' ) p++; + ptr = p; + tsz = ImGui::CalcTextSize( ptr, end ); + if( tsz.x < zsz ) return ptr; + } } const char* View::GetThreadContextData( uint64_t thread, bool& _local, bool& _untracked, const char*& program )