mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Try to display only frame time, if no space for full text.
This commit is contained in:
parent
2a6ccf8ee9
commit
db16aecf64
@ -1777,9 +1777,15 @@ bool View::DrawZoneFrames()
|
|||||||
if( fsz >= 5 )
|
if( fsz >= 5 )
|
||||||
{
|
{
|
||||||
auto buf = GetFrameText( i, ftime );
|
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;
|
uint32_t color = i == 0 ? 0xFF4444FF : 0xFFFFFFFF;
|
||||||
|
|
||||||
|
if( fsz - 5 <= tx )
|
||||||
|
{
|
||||||
|
buf = TimeToString( ftime );
|
||||||
|
tx = ImGui::CalcTextSize( buf ).x;
|
||||||
|
}
|
||||||
|
|
||||||
if( fbegin >= m_zvStart )
|
if( fbegin >= m_zvStart )
|
||||||
{
|
{
|
||||||
draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, 1 ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, ty - 1 ), color );
|
draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, 1 ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, ty - 1 ), color );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user