From 4821a5872033e90432cd5caabf39331462b37b2e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 7 Nov 2017 22:11:27 +0100 Subject: [PATCH] Fix frame line flicker on big zoom. --- server/TracyView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 765a8b04..80d05a86 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1917,13 +1917,13 @@ bool View::DrawZoneFrames() if( fsz - 5 > tx ) { const auto part = ( fsz - 5 - tx ) / 2; - draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, round( ty / 2 ) ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + part, round( ty / 2 ) ), color ); + draw->AddLine( wpos + ImVec2( std::max( -10.0, ( fbegin - m_zvStart ) * pxns + 2 ), round( ty / 2 ) ), wpos + ImVec2( std::min( w + 20.0, ( fbegin - m_zvStart ) * pxns + part ), round( ty / 2 ) ), color ); draw->AddText( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2 + part, 0 ), color, buf ); - draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2 + part + tx, round( ty / 2 ) ), wpos + ImVec2( ( fend - m_zvStart ) * pxns - 2, round( ty / 2 ) ), color ); + draw->AddLine( wpos + ImVec2( std::max( -10.0, ( fbegin - m_zvStart ) * pxns + 2 + part + tx ), round( ty / 2 ) ), wpos + ImVec2( std::min( w + 20.0, ( fend - m_zvStart ) * pxns - 2 ), round( ty / 2 ) ), color ); } else { - draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, round( ty / 2 ) ), wpos + ImVec2( ( fend - m_zvStart ) * pxns - 2, round( ty / 2 ) ), color ); + draw->AddLine( wpos + ImVec2( std::max( -10.0, ( fbegin - m_zvStart ) * pxns + 2 ), round( ty / 2 ) ), wpos + ImVec2( std::min( w + 20.0, ( fend - m_zvStart ) * pxns - 2 ), round( ty / 2 ) ), color ); } } }