Fix one frame lag of out-of-trace dimming.

This commit is contained in:
Bartosz Taudul 2021-11-22 01:19:37 +01:00
parent 6c08943e66
commit ac331d0343
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2916,18 +2916,6 @@ void View::DrawZones()
const auto w = ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ScrollbarSize; const auto w = ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ScrollbarSize;
const auto timespan = m_vd.zvEnd - m_vd.zvStart; const auto timespan = m_vd.zvEnd - m_vd.zvStart;
auto pxns = w / double( timespan ); auto pxns = w / double( timespan );
{
const auto tbegin = 0;
const auto tend = m_worker.GetLastTime();
if( tbegin > m_vd.zvStart )
{
draw->AddRectFilled( linepos, linepos + ImVec2( ( tbegin - m_vd.zvStart ) * pxns, lineh ), 0x44000000 );
}
if( tend < m_vd.zvEnd )
{
draw->AddRectFilled( linepos + ImVec2( ( tend - m_vd.zvStart ) * pxns, 0 ), linepos + ImVec2( w, lineh ), 0x44000000 );
}
}
const auto winpos = ImGui::GetWindowPos(); const auto winpos = ImGui::GetWindowPos();
const auto winsize = ImGui::GetWindowSize(); const auto winsize = ImGui::GetWindowSize();
@ -2945,6 +2933,19 @@ void View::DrawZones()
HandleZoneViewMouse( timespan, ImGui::GetCursorScreenPos(), w, pxns ); HandleZoneViewMouse( timespan, ImGui::GetCursorScreenPos(), w, pxns );
} }
{
const auto tbegin = 0;
const auto tend = m_worker.GetLastTime();
if( tbegin > m_vd.zvStart )
{
draw->AddRectFilled( linepos, linepos + ImVec2( ( tbegin - m_vd.zvStart ) * pxns, lineh ), 0x44000000 );
}
if( tend < m_vd.zvEnd )
{
draw->AddRectFilled( linepos + ImVec2( ( tend - m_vd.zvStart ) * pxns, 0 ), linepos + ImVec2( w, lineh ), 0x44000000 );
}
}
DrawZoneFramesHeader(); DrawZoneFramesHeader();
auto& frames = m_worker.GetFrames(); auto& frames = m_worker.GetFrames();
for( auto fd : frames ) for( auto fd : frames )