mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Add switch for vertical centering on/off at compile-time.
This commit is contained in:
parent
bca8f28f43
commit
ea1a0299f3
@ -324,9 +324,16 @@ void View::DrawTimeline()
|
||||
ImGui::SetNextWindowContentSize( ImVec2( 0, m_tc.GetHeight() ) );
|
||||
ImGui::BeginChild( "##zoneWin", ImVec2( ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y ), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||
|
||||
const auto verticallyCenterTimeline = true;
|
||||
|
||||
if( m_yDelta != 0 )
|
||||
{
|
||||
auto& io = ImGui::GetIO();
|
||||
if( !verticallyCenterTimeline )
|
||||
{
|
||||
auto y = ImGui::GetScrollY();
|
||||
ImGui::SetScrollY( y - m_yDelta );
|
||||
}
|
||||
io.MouseClickedPos[1].y = io.MousePos.y;
|
||||
}
|
||||
|
||||
@ -378,7 +385,8 @@ void View::DrawTimeline()
|
||||
}
|
||||
}
|
||||
|
||||
m_tc.End( pxns, wpos, hover, drawMouseLine && m_viewMode == ViewMode::Paused, yMin, yMax );
|
||||
const auto vcenter = verticallyCenterTimeline && drawMouseLine && m_viewMode == ViewMode::Paused;
|
||||
m_tc.End( pxns, wpos, hover, vcenter, yMin, yMax );
|
||||
ImGui::EndChild();
|
||||
|
||||
m_lockHighlight = m_nextLockHighlight;
|
||||
|
Loading…
Reference in New Issue
Block a user