mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Play a little animation when source file cannot be opened.
This commit is contained in:
parent
841f18885e
commit
07d2aaa1ad
@ -674,9 +674,9 @@ bool View::DrawImpl()
|
||||
if( m_showInfo ) DrawInfo();
|
||||
if( m_textEditorFile ) DrawTextEditor();
|
||||
|
||||
const auto& io = ImGui::GetIO();
|
||||
if( m_zoomAnim.active )
|
||||
{
|
||||
const auto& io = ImGui::GetIO();
|
||||
m_zoomAnim.progress += io.DeltaTime * m_zoomAnim.lenMod;
|
||||
if( m_zoomAnim.progress >= 1.f )
|
||||
{
|
||||
@ -692,6 +692,8 @@ bool View::DrawImpl()
|
||||
}
|
||||
}
|
||||
|
||||
m_callstackBuzzAnim.Update( io.DeltaTime );
|
||||
|
||||
return keepOpen;
|
||||
}
|
||||
|
||||
@ -5749,6 +5751,13 @@ void View::DrawCallstackWindow()
|
||||
}
|
||||
ImGui::NextColumn();
|
||||
ImGui::PushTextWrapPos( 0.0f );
|
||||
float indentVal = 0.f;
|
||||
if( m_callstackBuzzAnim.Match( fidx ) )
|
||||
{
|
||||
const auto time = m_callstackBuzzAnim.Time();
|
||||
indentVal = sin( time * 60.f ) * 10.f * time;
|
||||
ImGui::Indent( indentVal );
|
||||
}
|
||||
txt = m_worker.GetString( frame->file );
|
||||
if( frame->line == 0 )
|
||||
{
|
||||
@ -5768,6 +5777,14 @@ void View::DrawCallstackWindow()
|
||||
{
|
||||
SetTextEditorFile( txt, frame->line );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_callstackBuzzAnim.Enable( fidx, 0.5f );
|
||||
}
|
||||
}
|
||||
if( indentVal != 0.f )
|
||||
{
|
||||
ImGui::Unindent( indentVal );
|
||||
}
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::NextColumn();
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include "TracyBuzzAnim.hpp"
|
||||
#include "TracyDecayValue.hpp"
|
||||
#include "TracyVector.hpp"
|
||||
#include "TracyWorker.hpp"
|
||||
@ -236,6 +237,7 @@ private:
|
||||
|
||||
Namespace m_namespace;
|
||||
Animation m_zoomAnim;
|
||||
BuzzAnim<int> m_callstackBuzzAnim;
|
||||
|
||||
Vector<const ZoneEvent*> m_zoneInfoStack;
|
||||
Vector<const GpuEvent*> m_gpuInfoStack;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user