Proper display of negative time.

This commit is contained in:
Bartosz Taudul 2017-11-26 02:24:13 +01:00
parent b2b3e7d739
commit 4b548156b1

View File

@ -1989,10 +1989,15 @@ bool View::DrawZoneFrames()
if( tw == 0 ) if( tw == 0 )
{ {
char buf[128]; char buf[128];
auto txt = TimeToString( m_zvStart - m_frames[0] ); const auto t = m_zvStart - m_frames[0];
sprintf( buf, "+%s", txt ); auto txt = TimeToString( t );
draw->AddText( wpos + ImVec2( x, round( ty * 0.5 ) ), 0x66FFFFFF, buf ); if( t >= 0 )
tw = ImGui::CalcTextSize( buf ).x; {
sprintf( buf, "+%s", txt );
txt = buf;
}
draw->AddText( wpos + ImVec2( x, round( ty * 0.5 ) ), 0x66FFFFFF, txt );
tw = ImGui::CalcTextSize( txt ).x;
} }
else if( x > tx + tw + ty * 2 ) else if( x > tx + tw + ty * 2 )
{ {