diff --git a/server/TracyTimelineController.cpp b/server/TracyTimelineController.cpp index 5ac2f855..848548b5 100644 --- a/server/TracyTimelineController.cpp +++ b/server/TracyTimelineController.cpp @@ -57,7 +57,7 @@ void TimelineController::UpdateCenterItem() { m_centerItemkey = item->GetKey(); yBegin = yEnd; - yEnd += item->GetNextFrameHeight(); + yEnd += item->GetHeight(); const auto inLowerBounds = m_centerItemkey == m_items.front()->GetKey() || yBegin <= centerY; const auto inUpperBounds = m_centerItemkey == m_items.back()->GetKey() || centerY < yEnd; @@ -85,7 +85,7 @@ std::optional TimelineController::CalculateScrollPosition() const for( auto& item : m_items ) { yBegin = yEnd; - yEnd += item->GetNextFrameHeight(); + yEnd += item->GetHeight(); if( item->GetKey() != m_centerItemkey ) continue; @@ -139,19 +139,19 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool if( item->WantPreprocess() && item->IsVisible() ) { const auto yPos = wpos.y + yOffset; - const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetNextFrameHeight() >= yMin ); + const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetHeight() >= yMin ); item->Preprocess( ctx, m_td, visible ); } - yOffset += m_firstFrame ? 0 : item->GetNextFrameHeight(); + yOffset += m_firstFrame ? 0 : item->GetHeight(); } m_td.Sync(); yOffset = 0; for( auto& item : m_items ) { - auto currentFrameItemHeight = item->GetNextFrameHeight(); + auto currentFrameItemHeight = item->GetHeight(); item->Draw( m_firstFrame, ctx, yOffset ); - if( m_firstFrame ) currentFrameItemHeight = item->GetNextFrameHeight(); + if( m_firstFrame ) currentFrameItemHeight = item->GetHeight(); yOffset += currentFrameItemHeight; } diff --git a/server/TracyTimelineItem.hpp b/server/TracyTimelineItem.hpp index 3c8b7bbd..754c3b6c 100644 --- a/server/TracyTimelineItem.hpp +++ b/server/TracyTimelineItem.hpp @@ -33,7 +33,7 @@ public: void SetShowFull( bool showFull ) { m_showFull = showFull; } // returns 0 instead of the correct value for the first frame - int GetNextFrameHeight() const { return m_height; } + int GetHeight() const { return m_height; } const void* GetKey() const { return m_key; }