From fb801fa484526aef7c9cb8866ae44b5d20fc461c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 3 May 2020 14:34:05 +0200 Subject: [PATCH] Extract time value at mouse cursor to a variable. --- server/TracyView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 07d43667..c4e1f2d1 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5221,8 +5221,9 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, if( hover && ImGui::IsMouseHoveringRect( ImVec2( wpos.x, wpos.y + offset ), ImVec2( wpos.x + w, wpos.y + offset + cpuUsageHeight ), true ) ) { + const auto mt = m_vd.zvStart + ( ImGui::GetIO().MousePos.x - wpos.x ) * nspxdbl; int usageOwn, usageOther; - m_worker.GetCpuUsageAtTime( m_vd.zvStart + ( ImGui::GetIO().MousePos.x - wpos.x ) * nspxdbl, usageOwn, usageOther ); + m_worker.GetCpuUsageAtTime( mt, usageOwn, usageOther ); ImGui::BeginTooltip(); TextFocused( "Cores used by profiled program:", RealToString( usageOwn ) ); ImGui::SameLine();