Push item visibility to Preprocess().

This commit is contained in:
Bartosz Taudul
2023-03-25 15:10:58 +01:00
parent 8c1b519fa1
commit 7ec68f8b52
4 changed files with 9 additions and 6 deletions

View File

@@ -133,17 +133,20 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
ctx.wpos = wpos;
ctx.hover = hover;
int yOffset = 0;
for( auto& item : m_items )
{
if( item->WantPreprocess() && item->IsVisible() )
{
item->Preprocess( ctx, m_td );
const auto yPos = wpos.y + yOffset;
const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetNextFrameHeight() >= yMin );
item->Preprocess( ctx, m_td, visible );
}
yOffset += m_firstFrame ? 0 : item->GetNextFrameHeight();
}
m_td.Sync();
int yOffset = 0;
yOffset = 0;
for( auto& item : m_items )
{
auto currentFrameItemHeight = item->GetNextFrameHeight();