mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-19 22:25:59 +00:00
Limit "visible threads" rows displayed at once.
This commit is contained in:
@@ -523,6 +523,11 @@ void View::DrawWaitStacks()
|
||||
const auto MinWidth = std::max( 150 * GetScale(), probe );
|
||||
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
|
||||
|
||||
const auto rows = ( m_threadOrder.size() + cols - 1 ) / cols;
|
||||
const auto rowsVisible = std::min<size_t>( rows, 8 );
|
||||
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
|
||||
ImGui::BeginChild( "###waitstackthreadrows", ImVec2( -1, rowsHeight ) );
|
||||
|
||||
int idx = 0;
|
||||
ImGui::BeginTable( "##waitstackthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
|
||||
for( const auto& t : m_threadOrder )
|
||||
@@ -552,6 +557,7 @@ void View::DrawWaitStacks()
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
ImGui::EndChild();
|
||||
ImGui::TreePop();
|
||||
}
|
||||
if( threadsChanged ) m_waitStack = 0;
|
||||
|
||||
@@ -848,6 +848,11 @@ void View::DrawFlameGraph()
|
||||
const auto MinWidth = std::max( 150 * GetScale(), probe );
|
||||
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
|
||||
|
||||
const auto rows = ( tsz + cols - 1 ) / cols;
|
||||
const auto rowsVisible = std::min<size_t>( rows, 8 );
|
||||
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
|
||||
ImGui::BeginChild( "###flamegraphthreadrows", ImVec2( -1, rowsHeight ) );
|
||||
|
||||
int idx = 0;
|
||||
ImGui::BeginTable( "##flamegraphthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
|
||||
for( const auto& t : td )
|
||||
@@ -866,6 +871,7 @@ void View::DrawFlameGraph()
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
ImGui::EndChild();
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
||||
@@ -211,6 +211,11 @@ void View::DrawMessages()
|
||||
const auto MinWidth = std::max( 150 * GetScale(), probe );
|
||||
const int cols = std::max( 1, int( ImGui::GetContentRegionAvail().x / MinWidth ) );
|
||||
|
||||
const auto rows = ( tsz + cols - 1 ) / cols;
|
||||
const auto rowsVisible = std::min<size_t>( rows, 8 );
|
||||
const auto rowsHeight = ImGui::GetTextLineHeightWithSpacing() * rowsVisible;
|
||||
ImGui::BeginChild( "###msgthreadrows", ImVec2( -1, rowsHeight ) );
|
||||
|
||||
int idx = 0;
|
||||
ImGui::BeginTable( "##msgthreadcols", cols, ImGuiTableFlags_NoSavedSettings );
|
||||
for( const auto& t : m_threadOrder )
|
||||
@@ -240,6 +245,7 @@ void View::DrawMessages()
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
ImGui::EndChild();
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user