Try to display only frame time, if no space for full text.

This commit is contained in:
Bartosz Taudul 2017-10-28 21:55:01 +02:00
parent 2a6ccf8ee9
commit db16aecf64

View File

@ -1777,9 +1777,15 @@ bool View::DrawZoneFrames()
if( fsz >= 5 )
{
auto buf = GetFrameText( i, ftime );
const auto tx = ImGui::CalcTextSize( buf ).x;
auto tx = ImGui::CalcTextSize( buf ).x;
uint32_t color = i == 0 ? 0xFF4444FF : 0xFFFFFFFF;
if( fsz - 5 <= tx )
{
buf = TimeToString( ftime );
tx = ImGui::CalcTextSize( buf ).x;
}
if( fbegin >= m_zvStart )
{
draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, 1 ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, ty - 1 ), color );