mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Fix off-by-one-frame in timeline item height.
This commit is contained in:
parent
7b9b810421
commit
2df56e9941
@ -30,8 +30,10 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, float
|
||||
|
||||
for( auto& item : m_items )
|
||||
{
|
||||
auto currentFrameItemHeight = item->GetNextFrameHeight();
|
||||
item->Draw( m_firstFrame, pxns, yOffset, wpos, hover, yMin, yMax );
|
||||
yOffset += item->GetNextFrameHeight();
|
||||
if( m_firstFrame ) currentFrameItemHeight = item->GetNextFrameHeight();
|
||||
yOffset += currentFrameItemHeight;
|
||||
}
|
||||
|
||||
const auto scrollPos = ImGui::GetScrollY();
|
||||
|
@ -321,6 +321,7 @@ void View::DrawTimeline()
|
||||
const auto yMin = ImGui::GetCursorScreenPos().y;
|
||||
const auto yMax = linepos.y + lineh;
|
||||
|
||||
ImGui::SetNextWindowContentSize( ImVec2( 0, m_tc.GetHeight() ) );
|
||||
ImGui::BeginChild( "##zoneWin", ImVec2( ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y ), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||
|
||||
if( m_yDelta != 0 )
|
||||
@ -333,7 +334,6 @@ void View::DrawTimeline()
|
||||
|
||||
const auto wpos = ImGui::GetCursorScreenPos();
|
||||
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
||||
// note that m_tc.GetHeight() returns the height from the previous draw
|
||||
const auto h = std::max<float>( m_tc.GetHeight(), ImGui::GetContentRegionAvail().y - 4 ); // magic border value
|
||||
|
||||
ImGui::ItemSize( ImVec2( w, h ) );
|
||||
|
Loading…
Reference in New Issue
Block a user