diff --git a/server/TracyTimelineController.cpp b/server/TracyTimelineController.cpp index f0e0b648..2badc31c 100644 --- a/server/TracyTimelineController.cpp +++ b/server/TracyTimelineController.cpp @@ -30,8 +30,10 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, float for( auto& item : m_items ) { + auto currentFrameItemHeight = item->GetNextFrameHeight(); item->Draw( m_firstFrame, pxns, yOffset, wpos, hover, yMin, yMax ); - yOffset += item->GetNextFrameHeight(); + if( m_firstFrame ) currentFrameItemHeight = item->GetNextFrameHeight(); + yOffset += currentFrameItemHeight; } const auto scrollPos = ImGui::GetScrollY(); diff --git a/server/TracyView_Timeline.cpp b/server/TracyView_Timeline.cpp index cc656955..eddba3d0 100644 --- a/server/TracyView_Timeline.cpp +++ b/server/TracyView_Timeline.cpp @@ -321,6 +321,7 @@ void View::DrawTimeline() const auto yMin = ImGui::GetCursorScreenPos().y; const auto yMax = linepos.y + lineh; + ImGui::SetNextWindowContentSize( ImVec2( 0, m_tc.GetHeight() ) ); ImGui::BeginChild( "##zoneWin", ImVec2( ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y ), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse ); if( m_yDelta != 0 ) @@ -333,7 +334,6 @@ void View::DrawTimeline() const auto wpos = ImGui::GetCursorScreenPos(); const auto dpos = wpos + ImVec2( 0.5f, 0.5f ); - // note that m_tc.GetHeight() returns the height from the previous draw const auto h = std::max( m_tc.GetHeight(), ImGui::GetContentRegionAvail().y - 4 ); // magic border value ImGui::ItemSize( ImVec2( w, h ) );