mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Support adjusting plot height.
This commit is contained in:
@@ -58,6 +58,8 @@ struct ViewData
|
||||
ShortenName shortenName = ShortenName::NoSpaceAndNormalize;
|
||||
|
||||
uint32_t frameTarget = 60;
|
||||
|
||||
uint32_t plotHeight = 100;
|
||||
};
|
||||
|
||||
struct Annotation
|
||||
|
||||
@@ -541,6 +541,12 @@ void View::DrawOptions()
|
||||
val = m_vd.drawPlots;
|
||||
ImGui::Checkbox( ICON_FA_SIGNATURE " Draw plots", &val );
|
||||
m_vd.drawPlots = val;
|
||||
|
||||
ImGui::SameLine();
|
||||
int pH = m_vd.plotHeight;
|
||||
ImGui::SliderInt("Plot heights", &pH, 30, 200);
|
||||
m_vd.plotHeight = pH;
|
||||
|
||||
const auto expand = ImGui::TreeNode( "Plots" );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "(%zu)", m_worker.GetPlots().size() );
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
constexpr int PlotHeightPx = 100;
|
||||
|
||||
|
||||
bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vector<uint32_t>& plotDraw, int& offset )
|
||||
{
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
@@ -24,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 = PlotHeightPx * GetScale();
|
||||
const auto PlotHeight = GetViewData().plotHeight * GetScale();
|
||||
|
||||
auto yPos = wpos.y + offset;
|
||||
if( yPos + PlotHeight >= ctx.yMin && yPos <= ctx.yMax )
|
||||
|
||||
Reference in New Issue
Block a user