mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Reintroduce the vertical scroll-bar reset logic in TimelineController.
This commit is contained in:
parent
b4e8e042a8
commit
1969ef0f43
@ -7,6 +7,7 @@ namespace tracy
|
|||||||
|
|
||||||
TimelineController::TimelineController( View& view, Worker& worker )
|
TimelineController::TimelineController( View& view, Worker& worker )
|
||||||
: m_height( 0 )
|
: m_height( 0 )
|
||||||
|
, m_scroll( 0 )
|
||||||
, m_firstFrame( true )
|
, m_firstFrame( true )
|
||||||
, m_view( view )
|
, m_view( view )
|
||||||
, m_worker( worker )
|
, m_worker( worker )
|
||||||
@ -30,7 +31,12 @@ void TimelineController::End( double pxns, int offset, const ImVec2& wpos, bool
|
|||||||
item->Draw( m_firstFrame, pxns, offset, wpos, hover, yMin, yMax );
|
item->Draw( m_firstFrame, pxns, offset, wpos, hover, yMin, yMax );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_height = offset;
|
const auto scrollPos = ImGui::GetScrollY();
|
||||||
|
if( ( scrollPos == 0 && m_scroll != 0 ) || offset > m_height )
|
||||||
|
{
|
||||||
|
m_height = offset;
|
||||||
|
}
|
||||||
|
m_scroll = scrollPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ private:
|
|||||||
unordered_flat_map<const void*, std::unique_ptr<TimelineItem>> m_itemMap;
|
unordered_flat_map<const void*, std::unique_ptr<TimelineItem>> m_itemMap;
|
||||||
|
|
||||||
float m_height;
|
float m_height;
|
||||||
|
float m_scroll;
|
||||||
|
|
||||||
bool m_firstFrame;
|
bool m_firstFrame;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user