diff --git a/tools/jotpluggler/app.cc b/tools/jotpluggler/app.cc index 4b56299ea..f25656c7b 100644 --- a/tools/jotpluggler/app.cc +++ b/tools/jotpluggler/app.cc @@ -324,7 +324,7 @@ void configure_style() { plot_style.LegendInnerPadding = ImVec2(6.0f, 3.0f); plot_style.LegendSpacing = ImVec2(7.0f, 2.0f); plot_style.PlotPadding = ImVec2(4.0f, 8.0f); - plot_style.FitPadding = ImVec2(0.02f, 0.4f); + plot_style.FitPadding = ImVec2(0.02f, static_cast(PLOT_Y_PADDING_FRACTION)); ImPlot::MapInputDefault(); ImPlotInputMap &input_map = ImPlot::GetInputMap(); diff --git a/tools/jotpluggler/internal.h b/tools/jotpluggler/internal.h index 22a5c1dd9..b70aec1a5 100644 --- a/tools/jotpluggler/internal.h +++ b/tools/jotpluggler/internal.h @@ -58,6 +58,7 @@ inline constexpr float SIDEBAR_MAX_WIDTH = 520.0f; inline constexpr float TIMELINE_BAR_HEIGHT = 14.0f; inline constexpr float STATUS_BAR_HEIGHT = 52.0f; inline constexpr double MIN_HORIZONTAL_ZOOM_SECONDS = 2.0; +inline constexpr double PLOT_Y_PADDING_FRACTION = 0.05; struct UiMetrics { float width = 0.0f; diff --git a/tools/jotpluggler/plot.cc b/tools/jotpluggler/plot.cc index b1324713a..270dc9055 100644 --- a/tools/jotpluggler/plot.cc +++ b/tools/jotpluggler/plot.cc @@ -7,8 +7,6 @@ #include #include -constexpr double PLOT_Y_PAD_FRACTION = 0.4; - struct PlotBounds { double x_min = 0.0; double x_max = 1.0; @@ -484,7 +482,7 @@ PlotBounds compute_plot_bounds(const Pane &pane, min_value = std::min(min_value, 0.0); max_value = std::max(max_value, 1.0); } - ensure_non_degenerate_range(&min_value, &max_value, PLOT_Y_PAD_FRACTION, 0.1); + ensure_non_degenerate_range(&min_value, &max_value, PLOT_Y_PADDING_FRACTION, 0.1); if (pane.range.has_y_limit_min) { min_value = pane.range.y_limit_min; }