mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Display time stamp when hovering mouse over time scale.
This commit is contained in:
parent
5e559322a0
commit
833653ce40
@ -2020,16 +2020,20 @@ void View::DrawZoneFramesHeader()
|
|||||||
const auto ty0375 = round( ty * 0.375f );
|
const auto ty0375 = round( ty * 0.375f );
|
||||||
const auto ty05 = round( ty * 0.5f );
|
const auto ty05 = round( ty * 0.5f );
|
||||||
|
|
||||||
ImGui::InvisibleButton( "##zoneFrames", ImVec2( w, ty * 1.5f ) );
|
const auto timespan = m_vd.zvEnd - m_vd.zvStart;
|
||||||
|
const auto pxns = w / double( timespan );
|
||||||
auto timespan = m_vd.zvEnd - m_vd.zvStart;
|
|
||||||
auto pxns = w / double( timespan );
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto nspx = 1.0 / pxns;
|
const auto nspx = 1.0 / pxns;
|
||||||
const auto scale = std::max( 0.0, round( log10( nspx ) + 2 ) );
|
const auto scale = std::max( 0.0, round( log10( nspx ) + 2 ) );
|
||||||
const auto step = pow( 10, scale );
|
const auto step = pow( 10, scale );
|
||||||
|
|
||||||
|
ImGui::InvisibleButton( "##zoneFrames", ImVec2( w, ty * 1.5f ) );
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
ImGui::TextUnformatted( TimeToStringExact( m_vd.zvStart + ( ImGui::GetIO().MousePos.x - wpos.x ) * nspx ) );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
const auto dx = step * pxns;
|
const auto dx = step * pxns;
|
||||||
double x = 0;
|
double x = 0;
|
||||||
int tw = 0;
|
int tw = 0;
|
||||||
@ -2074,7 +2078,6 @@ void View::DrawZoneFramesHeader()
|
|||||||
x += dx;
|
x += dx;
|
||||||
tt += step;
|
tt += step;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t DarkenColor( uint32_t color )
|
static uint32_t DarkenColor( uint32_t color )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user