From b879f5b519e4ea0c1f79a7e477016cabd83daa9a Mon Sep 17 00:00:00 2001 From: Martijn Courteaux Date: Wed, 8 May 2024 10:43:14 +0200 Subject: [PATCH] Save plot height view data. --- profiler/src/profiler/TracyUserData.cpp | 2 ++ profiler/src/profiler/TracyView_Plots.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyUserData.cpp b/profiler/src/profiler/TracyUserData.cpp index df0fb9cb..87c6d5f0 100644 --- a/profiler/src/profiler/TracyUserData.cpp +++ b/profiler/src/profiler/TracyUserData.cpp @@ -145,6 +145,7 @@ void UserData::LoadState( ViewData& data ) if( ini_sget( ini, "options", "ghostZones", "%d", &v ) ) data.ghostZones = v; if( ini_sget( ini, "options", "frameTarget", "%d", &v ) ) data.frameTarget = v; if( ini_sget( ini, "options", "shortenName", "%d", &v ) ) data.shortenName = (ShortenName)v; + if( ini_sget( ini, "options", "plotHeight", "%d", &v ) ) data.plotHeight = v; ini_free( ini ); } } @@ -193,6 +194,7 @@ void UserData::SaveState( const ViewData& data ) fprintf( f, "ghostZones = %d\n", data.ghostZones ); fprintf( f, "frameTarget = %d\n", data.frameTarget ); fprintf( f, "shortenName = %d\n", (int)data.shortenName ); + fprintf( f, "plotHeight = %d\n", data.plotHeight ); fclose( f ); } } diff --git a/profiler/src/profiler/TracyView_Plots.cpp b/profiler/src/profiler/TracyView_Plots.cpp index e1d03837..9eb02a6c 100644 --- a/profiler/src/profiler/TracyView_Plots.cpp +++ b/profiler/src/profiler/TracyView_Plots.cpp @@ -21,7 +21,7 @@ bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vect const auto hover = ctx.hover; const auto ty = ctx.ty; - const auto PlotHeight = GetViewData().plotHeight * GetScale(); + const auto PlotHeight = m_vd.plotHeight * GetScale(); auto yPos = wpos.y + offset; if( yPos + PlotHeight >= ctx.yMin && yPos <= ctx.yMax )