1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Plot fill may be disabled.

This commit is contained in:
Bartosz Taudul 2022-07-24 13:28:12 +02:00
parent b2a94cbfa2
commit f354735fc4
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -260,14 +260,20 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
const auto y1 = PlotHeight - ( it->val - min ) * revrange * PlotHeight; const auto y1 = PlotHeight - ( it->val - min ) * revrange * PlotHeight;
if( v->showSteps ) if( v->showSteps )
{
if( v->fill )
{ {
draw->AddRectFilled( dpos + ImVec2( x0, offset + PlotHeight ), dpos + ImVec2( x1, offset + y0 ), fill ); 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 ) }; 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 ); draw->AddPolyline( data, 3, color, 0, 1.0f );
} }
else else
{
if( v->fill )
{ {
draw->AddQuadFilled( dpos + ImVec2( x0, offset + PlotHeight ), dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), dpos + ImVec2( x1, offset + PlotHeight ), fill ); 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 ); DrawLine( draw, dpos + ImVec2( x0, offset + y0 ), dpos + ImVec2( x1, offset + y1 ), color );
} }