Constrain flame graph window size.

This commit is contained in:
Bartosz Taudul
2026-07-18 13:15:22 +02:00
parent 562fea5564
commit 2d2487e2e0
3 changed files with 7 additions and 0 deletions

View File

@@ -1528,6 +1528,7 @@ bool View::WasActive() const
void View::DpiScaleChanged()
{
m_flameGraphConstraint.Reset();
}
void View::AddLlmAttachment( const nlohmann::json& json )

View File

@@ -25,6 +25,7 @@
#include "TracyUserData.hpp"
#include "TracyUtility.hpp"
#include "TracyViewData.hpp"
#include "TracyWindowConstraints.hpp"
#include "../server/TracyFileWrite.hpp"
#include "../server/TracyTaskDispatch.hpp"
#include "../server/TracyShortPtr.hpp"
@@ -1092,6 +1093,8 @@ private:
std::array<RangeEntry, size_t( RangeId::NUM )> m_ranges;
WindowConstraints m_flameGraphConstraint;
#ifndef __EMSCRIPTEN__
TracyLlm m_llm;

View File

@@ -910,6 +910,7 @@ void View::DrawFlameGraph()
{
const auto scale = GetScale();
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
m_flameGraphConstraint.Constrain();
ImGui::Begin( "Flame graph", &m_showFlameGraph, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
if( ImGui::GetCurrentWindowRead()->SkipItems ) { ImGui::End(); return; }
@@ -999,6 +1000,8 @@ void View::DrawFlameGraph()
m_flameGraphPan = 0;
}
m_flameGraphConstraint.MarkMinWidth();
UpdateThreadOrder();
const auto& td = m_threadOrder;
auto expand = ImGui::TreeNode( ICON_FA_SHUFFLE " Visible threads:" );