mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Extract crash tooltip to a separate function.
This commit is contained in:
parent
281dcf7c1f
commit
b8794f64be
@ -1926,11 +1926,7 @@ void View::DrawZones()
|
|||||||
|
|
||||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px - (ty - to) * 0.5 - 1, oldOffset ), wpos + ImVec2( px + (ty - to) * 0.5 + 1, oldOffset + ty ) ) )
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px - (ty - to) * 0.5 - 1, oldOffset ), wpos + ImVec2( px + (ty - to) * 0.5 + 1, oldOffset + ty ) ) )
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
CrashTooltip();
|
||||||
TextFocused( "Time:", TimeToString( crash.time - m_worker.GetTimeBegin() ) );
|
|
||||||
TextFocused( "Reason:", m_worker.GetString( crash.message ) );
|
|
||||||
ImGui::EndTooltip();
|
|
||||||
|
|
||||||
if( ImGui::IsMouseClicked( 0 ) )
|
if( ImGui::IsMouseClicked( 0 ) )
|
||||||
{
|
{
|
||||||
m_showInfo = true;
|
m_showInfo = true;
|
||||||
@ -10543,6 +10539,15 @@ void View::CallstackTooltip( uint32_t idx )
|
|||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::CrashTooltip()
|
||||||
|
{
|
||||||
|
auto& crash = m_worker.GetCrashEvent();
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
TextFocused( "Time:", TimeToString( crash.time - m_worker.GetTimeBegin() ) );
|
||||||
|
TextFocused( "Reason:", m_worker.GetString( crash.message ) );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
const ZoneEvent* View::GetZoneParent( const ZoneEvent& zone ) const
|
const ZoneEvent* View::GetZoneParent( const ZoneEvent& zone ) const
|
||||||
{
|
{
|
||||||
for( const auto& thread : m_worker.GetThreadData() )
|
for( const auto& thread : m_worker.GetThreadData() )
|
||||||
|
@ -168,6 +168,7 @@ private:
|
|||||||
void ZoneTooltip( const ZoneEvent& ev );
|
void ZoneTooltip( const ZoneEvent& ev );
|
||||||
void ZoneTooltip( const GpuEvent& ev );
|
void ZoneTooltip( const GpuEvent& ev );
|
||||||
void CallstackTooltip( uint32_t idx );
|
void CallstackTooltip( uint32_t idx );
|
||||||
|
void CrashTooltip();
|
||||||
|
|
||||||
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
||||||
const GpuEvent* GetZoneParent( const GpuEvent& zone ) const;
|
const GpuEvent* GetZoneParent( const GpuEvent& zone ) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user