From d6772900add761b54fd9b316f033fdbd722ef7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20V=C3=B6r=C3=B6=C5=A1?= Date: Sun, 18 Dec 2022 20:09:15 +0100 Subject: [PATCH] Get rid of a non-linearity in TimelineItem resizing animation. --- server/TracyTimelineItem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/TracyTimelineItem.cpp b/server/TracyTimelineItem.cpp index 2d71330e..498ea205 100644 --- a/server/TracyTimelineItem.cpp +++ b/server/TracyTimelineItem.cpp @@ -121,8 +121,8 @@ void TimelineItem::Draw( bool firstFrame, double pxns, int& offset, const ImVec2 void TimelineItem::AdjustThreadHeight( bool firstFrame, int oldOffset, int& offset ) { - const auto speed = 5.0; - const auto minMove = 1.0; + const auto speed = 4.0; + const auto baseMove = 1.0; const auto h = offset - oldOffset; if( firstFrame ) @@ -135,12 +135,12 @@ void TimelineItem::AdjustThreadHeight( bool firstFrame, int oldOffset, int& offs const auto preClampMove = diff * speed * ImGui::GetIO().DeltaTime; if( diff > 0 ) { - const auto move = std::max( minMove, preClampMove ); + const auto move = preClampMove + baseMove; m_height = int( std::min( m_height + move, h ) ); } else { - const auto move = std::min( -minMove, preClampMove ); + const auto move = preClampMove - baseMove; m_height = int( std::max( m_height + move, h ) ); } s_wasActive = true;