Don't use space for frame sets that are out of view range.

This becomes problematic at the end of the range, as continuous frames do not
have an "end", but rather essentially persist until the last recorded event.
This commit is contained in:
Bartosz Taudul 2022-09-07 23:35:27 +02:00
parent f16c64872b
commit 5bd3f3de5f
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -93,6 +93,10 @@ void View::DrawTimelineFramesHeader()
void View::DrawTimelineFrames( const FrameData& frames )
{
const std::pair <int, int> zrange = m_worker.GetFrameRange( frames, m_vd.zvStart, m_vd.zvEnd );
if( zrange.first < 0 ) return;
if( m_worker.GetFrameBegin( frames, zrange.first ) > m_vd.zvEnd || m_worker.GetFrameEnd( frames, zrange.second ) < m_vd.zvStart ) return;
const auto wpos = ImGui::GetCursorScreenPos();
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
const auto w = ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ScrollbarSize;
@ -110,9 +114,6 @@ void View::DrawTimelineFrames( const FrameData& frames )
const auto nspx = 1.0 / pxns;
const std::pair <int, int> zrange = m_worker.GetFrameRange( frames, m_vd.zvStart, m_vd.zvEnd );
if( zrange.first < 0 ) return;
int64_t prev = -1;
int64_t prevEnd = -1;
int64_t endPos = -1;