mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Refactor the use of offset in TimelineItem::Draw() and TimelineController::End().
This commit is contained in:
@@ -24,17 +24,20 @@ void TimelineController::Begin()
|
||||
m_items.clear();
|
||||
}
|
||||
|
||||
void TimelineController::End( double pxns, int offset, const ImVec2& wpos, bool hover, float yMin, float yMax )
|
||||
void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax )
|
||||
{
|
||||
int yOffset = 0;
|
||||
|
||||
for( auto& item : m_items )
|
||||
{
|
||||
item->Draw( m_firstFrame, pxns, offset, wpos, hover, yMin, yMax );
|
||||
item->Draw( m_firstFrame, pxns, yOffset, wpos, hover, yMin, yMax );
|
||||
yOffset += item->GetNextFrameHeight();
|
||||
}
|
||||
|
||||
const auto scrollPos = ImGui::GetScrollY();
|
||||
if( ( scrollPos == 0 && m_scroll != 0 ) || offset > m_height )
|
||||
if( ( scrollPos == 0 && m_scroll != 0 ) || yOffset > m_height )
|
||||
{
|
||||
m_height = offset;
|
||||
m_height = yOffset;
|
||||
}
|
||||
m_scroll = scrollPos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user