diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c64e48ce..aa1ccd9b 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3922,22 +3922,29 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl } pdqsort_branchless( tmpvec, dst ); - draw->AddLine( wpos + ImVec2( x1, offset + PlotHeight - ( tmpvec[0] - min ) * revrange * PlotHeight ), wpos + ImVec2( x1, offset + PlotHeight - ( dst[-1] - min ) * revrange * PlotHeight ), 0xFF44DDDD ); - - auto vit = tmpvec; - while( vit != dst ) + if( rsz > MaxPoints ) { - auto vrange = std::upper_bound( vit, dst, *vit + 3.0 / ( revrange * PlotHeight ), [] ( const auto& l, const auto& r ) { return l < r; } ); - assert( vrange > vit ); - if( std::distance( vit, vrange ) == 1 ) + draw->AddLine( wpos + ImVec2( x1, offset + PlotHeight - ( tmpvec[0] - min ) * revrange * PlotHeight ), wpos + ImVec2( x1, offset + PlotHeight - ( dst[-1] - min ) * revrange * PlotHeight ), 0xFF44DDDD, 4.f ); + } + else + { + draw->AddLine( wpos + ImVec2( x1, offset + PlotHeight - ( tmpvec[0] - min ) * revrange * PlotHeight ), wpos + ImVec2( x1, offset + PlotHeight - ( dst[-1] - min ) * revrange * PlotHeight ), 0xFF44DDDD ); + + auto vit = tmpvec; + while( vit != dst ) { - DrawPlotPoint( wpos, x1, PlotHeight - ( *vit - min ) * revrange * PlotHeight, offset, 0xFF44DDDD, hover, false, *vit, 0, false, v->type, PlotHeight ); + auto vrange = std::upper_bound( vit, dst, *vit + 3.0 / ( revrange * PlotHeight ), [] ( const auto& l, const auto& r ) { return l < r; } ); + assert( vrange > vit ); + if( std::distance( vit, vrange ) == 1 ) + { + DrawPlotPoint( wpos, x1, PlotHeight - ( *vit - min ) * revrange * PlotHeight, offset, 0xFF44DDDD, hover, false, *vit, 0, false, v->type, PlotHeight ); + } + else + { + DrawPlotPoint( wpos, x1, PlotHeight - ( *vit - min ) * revrange * PlotHeight, offset, 0xFF44DDDD, hover, false, *vit, 0, true, v->type, PlotHeight ); + } + vit = vrange; } - else - { - DrawPlotPoint( wpos, x1, PlotHeight - ( *vit - min ) * revrange * PlotHeight, offset, 0xFF44DDDD, hover, false, *vit, 0, true, v->type, PlotHeight ); - } - vit = vrange; } prevy = it - 1;