mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Plots may now be drawn as staircases.
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user