Use vStart retrieved from ctx.

This commit is contained in:
Bartosz Taudul 2023-03-22 20:52:31 +01:00
parent 1e67c8bce2
commit a3947fbc57
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -308,8 +308,8 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
case ContextSwitchDrawType::Running: case ContextSwitchDrawType::Running:
{ {
const auto end = ev.IsEndValid() ? ev.End() : m_worker.GetLastTime(); const auto end = ev.IsEndValid() ? ev.End() : m_worker.GetLastTime();
const auto px0 = std::max( { ( ev.Start() - m_vd.zvStart ) * pxns, -10.0, double( v.minpx ) } ); const auto px0 = std::max( { ( ev.Start() - vStart ) * pxns, -10.0, double( v.minpx ) } );
const auto px1 = std::min( ( end - m_vd.zvStart ) * pxns, w + 10.0 ); const auto px1 = std::min( ( end - vStart ) * pxns, w + 10.0 );
DrawLine( draw, dpos + ImVec2( px0, offset + ty05 - 0.5f ), dpos + ImVec2( px1, offset + ty05 - 0.5f ), 0xFF22DD22, lineSize ); DrawLine( draw, dpos + ImVec2( px0, offset + ty05 - 0.5f ), dpos + ImVec2( px1, offset + ty05 - 0.5f ), 0xFF22DD22, lineSize );
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + ty + 1 ) ) ) if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + ty + 1 ) ) )
{ {