Remove missed plot vector sorting during draw.

This commit is contained in:
Bartosz Taudul 2023-04-27 17:36:11 +02:00
parent 082beb66c9
commit 52e3ae719d
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -16,10 +16,6 @@ constexpr int PlotHeightPx = 100;
bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vector<uint32_t>& plotDraw, int& offset ) bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vector<uint32_t>& plotDraw, int& offset )
{ {
auto& vec = plot.data;
vec.ensure_sorted();
if( vec.front().time.Val() > m_vd.zvEnd || vec.back().time.Val() < m_vd.zvStart ) return false;
auto draw = ImGui::GetWindowDrawList(); auto draw = ImGui::GetWindowDrawList();
const auto& wpos = ctx.wpos; const auto& wpos = ctx.wpos;
const auto dpos = wpos + ImVec2( 0.5f, 0.5f ); const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
@ -75,6 +71,7 @@ bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vect
bool first = true; bool first = true;
while( it < end ) while( it < end )
{ {
auto& vec = plot.data;
const auto cnt = *it++; const auto cnt = *it++;
const auto i0 = *it++; const auto i0 = *it++;
const auto& v0 = vec[i0]; const auto& v0 = vec[i0];