Fix an edge case in zone drawing.

If the last zone on a track was not ended, and in the view's past
(beyond the left edge of the view) it was still included in calculation
of track height.
This commit is contained in:
Bartosz Taudul 2018-10-06 12:52:05 +02:00
parent 299d1d7a73
commit 4ca4c85976

View File

@ -1864,6 +1864,7 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
const auto zitend = std::lower_bound( it, vec.end(), m_zvEnd + resolution, [] ( const auto& l, const auto& r ) { return l->start < r; } ); const auto zitend = std::lower_bound( it, vec.end(), m_zvEnd + resolution, [] ( const auto& l, const auto& r ) { return l->start < r; } );
if( it == zitend ) return depth; if( it == zitend ) return depth;
if( (*it)->end < 0 && m_worker.GetZoneEnd( **it ) < m_zvStart ) return depth;
const auto w = ImGui::GetWindowContentRegionWidth() - 1; const auto w = ImGui::GetWindowContentRegionWidth() - 1;
const auto ty = ImGui::GetFontSize(); const auto ty = ImGui::GetFontSize();