diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-07-24 13:37:30 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-07-24 13:37:30 +0300 |
commit | 16627d731329868ce6b23f498f8c5f138daee048 (patch) | |
tree | 545103e91dd2ea2eb3c86f04baa10b4e447145ab /server/TracyView_Plots.cpp | |
parent | f8115168a670c65bbaaccd46041e20f3d1ce63c4 (diff) |
Plots may now be drawn as staircases.
Diffstat (limited to 'server/TracyView_Plots.cpp')
-rw-r--r-- | server/TracyView_Plots.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/TracyView_Plots.cpp b/server/TracyView_Plots.cpp index 3d6d60be..3d90b5a1 100644 --- a/server/TracyView_Plots.cpp +++ b/server/TracyView_Plots.cpp @@ -259,8 +259,17 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl const auto y0 = PlotHeight - ( prevy->val - min ) * revrange * PlotHeight; const auto y1 = PlotHeight - ( it->val - min ) * revrange * PlotHeight; - draw->AddQuadFilled( dpos + ImVec2( x0, offset + PlotHeight ), dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), dpos + ImVec2( x1, offset + PlotHeight ), fill ); - DrawLine( draw, dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), color ); + if( v->showSteps ) + { + draw->AddRectFilled( dpos + ImVec2( x0, offset + PlotHeight ), dpos + ImVec2( x1, offset + y0 ), fill ); + const ImVec2 data[3] = { dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y0 ), dpos + ImVec2( x1, offset + y1 ) }; + draw->AddPolyline( data, 3, color, 0, 1.0f ); + } + else + { + draw->AddQuadFilled( dpos + ImVec2( x0, offset + PlotHeight ), dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), dpos + ImVec2( x1, offset + PlotHeight ), fill ); + DrawLine( draw, dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), color ); + } const auto rx = skip == 0 ? 2.0 : ( skip == 1 ? 2.5 : 4.0 ); |