Remove VisData.

Its functionality is now incorporated into TimelineItem. For purposes of
maintaining visibility of frame sets and locks a much simpler ptr -> bool map
is now used.
This commit is contained in:
Bartosz Taudul
2022-09-04 14:46:51 +02:00
parent ad2fc03125
commit 44efb15df1
8 changed files with 28 additions and 85 deletions

View File

@@ -44,45 +44,4 @@ void TimelineController::End( double pxns, int offset, const ImVec2& wpos, bool
m_scroll = scrollPos;
}
float TimelineController::AdjustThreadPosition( VisData& vis, float wy, int& offset )
{
if( vis.offset < offset )
{
vis.offset = offset;
}
else if( vis.offset > offset )
{
const auto diff = vis.offset - offset;
const auto move = std::max( 2.0, diff * 10.0 * ImGui::GetIO().DeltaTime );
offset = vis.offset = int( std::max<double>( vis.offset - move, offset ) );
}
return offset + wy;
}
void TimelineController::AdjustThreadHeight( VisData& vis, int oldOffset, int& offset )
{
const auto h = offset - oldOffset;
if( vis.height > h )
{
vis.height = h;
offset = oldOffset + vis.height;
}
else if( vis.height < h )
{
if( m_firstFrame )
{
vis.height = h;
offset = oldOffset + h;
}
else
{
const auto diff = h - vis.height;
const auto move = std::max( 2.0, diff * 10.0 * ImGui::GetIO().DeltaTime );
vis.height = int( std::min<double>( vis.height + move, h ) );
offset = oldOffset + vis.height;
}
}
}
}