mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Change GetNextFrameHeight() to GetHeight().
The GetNextFrameHeight() name correctness was very situational. It was often used in the meaning of "get current frame height".
This commit is contained in:
parent
7ec68f8b52
commit
96d60ce626
@ -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<int> 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;
|
||||
}
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user