mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 09:14:36 +00:00
Extract time value at mouse cursor to a variable.
This commit is contained in:
parent
9d94cdbb52
commit
fb801fa484
@ -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 ) )
|
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;
|
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();
|
ImGui::BeginTooltip();
|
||||||
TextFocused( "Cores used by profiled program:", RealToString( usageOwn ) );
|
TextFocused( "Cores used by profiled program:", RealToString( usageOwn ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user