From 2d5066418092f450e0c8eef1a7c5c3c82100180b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 10 Feb 2019 13:01:16 +0100 Subject: [PATCH] Use multiply instead of divide. --- server/TracyView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8a91fd80..c96e5ec0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4157,13 +4157,14 @@ void View::DrawZoneInfoWindow() pdqsort_branchless( cti.get(), cti.get() + children.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } ); + const auto rztime = 1.0 / ztime; const auto ty = ImGui::GetTextLineHeight(); ImGui::Columns( 2 ); ImGui::TextColored( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" ); ImGui::NextColumn(); char buf[128]; sprintf( buf, "%s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 ); - ImGui::ProgressBar( double( ztime - ctime ) / ztime, ImVec2( -1, ty ), buf ); + ImGui::ProgressBar( double( ztime - ctime ) * rztime, ImVec2( -1, ty ), buf ); ImGui::NextColumn(); for( size_t i=0; i