From 0412b12e113f7bc699e160eaaaae6fd045411512 Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Fri, 15 May 2020 08:05:02 -0500 Subject: [PATCH] tidy up warnings fixes --- implot.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/implot.cpp b/implot.cpp index c57c0e4..134184a 100644 --- a/implot.cpp +++ b/implot.cpp @@ -231,7 +231,6 @@ ImVec4 NextColor(); // Structs //----------------------------------------------------------------------------- - /// Tick mark info struct ImTick { ImTick(double value, bool major, bool render_label = true) { @@ -449,6 +448,11 @@ inline ImVec2 PixelsToPlot(float x, float y, int y_axis_in = -1) { return plt; } +ImVec2 PixelsToPlot(const ImVec2& pix, int y_axis) { + return PixelsToPlot(pix.x, pix.y, y_axis); +} + +// This function is convenient but should not be used to process a high volume of points. Use the Transformer structs below instead. inline ImVec2 PlotToPixels(float x, float y, int y_axis_in = -1) { IM_ASSERT_USER_ERROR(gp.CurrentPlot != NULL, "PlotToPixels() Needs to be called between BeginPlot() and EndPlot()!"); const int y_axis = y_axis_in >= 0 ? y_axis_in : gp.CurrentPlot->CurrentYAxis; @@ -466,14 +470,13 @@ inline ImVec2 PlotToPixels(float x, float y, int y_axis_in = -1) { return pix; } -ImVec2 PixelsToPlot(const ImVec2& pix, int y_axis) { - return PixelsToPlot(pix.x, pix.y, y_axis); -} - +// This function is convenient but should not be used to process a high volume of points. Use the Transformer structs below instead. ImVec2 PlotToPixels(const ImVec2& plt, int y_axis) { return PlotToPixels(plt.x, plt.y, y_axis); } +// Transformer structs + struct Plt2PixLinLin { Plt2PixLinLin(int y_axis_in) : y_axis(y_axis_in) {}