mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-13 03:41:48 +00:00
Simple and not so simple draw plot point functions.
This commit is contained in:
parent
3236164116
commit
3ea5fd93ed
@ -2470,7 +2470,7 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
|||||||
{
|
{
|
||||||
const auto x = ( it->time - m_zvStart ) * pxns;
|
const auto x = ( it->time - m_zvStart ) * pxns;
|
||||||
const auto y = PlotHeight - ( it->val - min ) * revrange * PlotHeight;
|
const auto y = PlotHeight - ( it->val - min ) * revrange * PlotHeight;
|
||||||
DrawPlotPoint( wpos, x, y, offset, 0xFF44DDDD, hover, false, it->val, 0, false );
|
DrawPlotPoint( wpos, x, y, offset, 0xFF44DDDD, hover, false, it, 0, false, v->type );
|
||||||
}
|
}
|
||||||
|
|
||||||
auto prevx = it;
|
auto prevx = it;
|
||||||
@ -2493,7 +2493,7 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
|||||||
const auto rsz = std::distance( it, range );
|
const auto rsz = std::distance( it, range );
|
||||||
if( rsz == 1 )
|
if( rsz == 1 )
|
||||||
{
|
{
|
||||||
DrawPlotPoint( wpos, x1, y1, offset, 0xFF44DDDD, hover, true, it->val, prevy->val, false );
|
DrawPlotPoint( wpos, x1, y1, offset, 0xFF44DDDD, hover, true, it, prevy->val, false, v->type );
|
||||||
prevx = it;
|
prevx = it;
|
||||||
prevy = it;
|
prevy = it;
|
||||||
++it;
|
++it;
|
||||||
@ -2594,6 +2594,30 @@ void View::DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, const PlotItem* item, double prev, bool merged, PlotType type )
|
||||||
|
{
|
||||||
|
auto draw = ImGui::GetWindowDrawList();
|
||||||
|
if( merged )
|
||||||
|
{
|
||||||
|
draw->AddRectFilled( wpos + ImVec2( x - 1.5f, offset + y - 1.5f ), wpos + ImVec2( x + 2.5f, offset + y + 2.5f ), color );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
draw->AddRect( wpos + ImVec2( x - 1.5f, offset + y - 1.5f ), wpos + ImVec2( x + 2.5f, offset + y + 2.5f ), color );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( x - 2, offset ), wpos + ImVec2( x + 2, offset + PlotHeight ) ) )
|
||||||
|
{
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
ImGui::Text( "Value: %s", RealToString( item->val, true ) );
|
||||||
|
if( hasPrev )
|
||||||
|
{
|
||||||
|
ImGui::Text( "Change: %s", RealToString( item->val - prev, true ) );
|
||||||
|
}
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void View::DrawInfoWindow()
|
void View::DrawInfoWindow()
|
||||||
{
|
{
|
||||||
if( m_zoneInfoWindow )
|
if( m_zoneInfoWindow )
|
||||||
|
@ -74,6 +74,7 @@ private:
|
|||||||
int SkipGpuZoneLevel( const Vector<GpuEvent*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax );
|
int SkipGpuZoneLevel( const Vector<GpuEvent*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax );
|
||||||
int DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, int offset, LockHighlight& highlight, float yMin, float yMax );
|
int DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, int offset, LockHighlight& highlight, float yMin, float yMax );
|
||||||
int DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
int DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
||||||
|
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, const PlotItem* item, double prev, bool merged, PlotType type );
|
||||||
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, double val, double prev, bool merged );
|
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, double val, double prev, bool merged );
|
||||||
void DrawOptions();
|
void DrawOptions();
|
||||||
void DrawMessages();
|
void DrawMessages();
|
||||||
|
Loading…
Reference in New Issue
Block a user