MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / PixelsToPlot

Function PixelsToPlot

Source/3rdParty/implot/implot.cpp:3737–3747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3735}
3736
3737ImPlotPoint PixelsToPlot(float x, float y, ImAxis x_idx, ImAxis y_idx) {
3738 ImPlotContext& gp = *GImPlot;
3739 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "PixelsToPlot() needs to be called between BeginPlot() and EndPlot()!");
3740 IM_ASSERT_USER_ERROR(x_idx == IMPLOT_AUTO || (x_idx >= ImAxis_X1 && x_idx < ImAxis_Y1), "X-Axis index out of bounds!");
3741 IM_ASSERT_USER_ERROR(y_idx == IMPLOT_AUTO || (y_idx >= ImAxis_Y1 && y_idx < ImAxis_COUNT), "Y-Axis index out of bounds!");
3742 SetupLock();
3743 ImPlotPlot& plot = *gp.CurrentPlot;
3744 ImPlotAxis& x_axis = x_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentX] : plot.Axes[x_idx];
3745 ImPlotAxis& y_axis = y_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentY] : plot.Axes[y_idx];
3746 return ImPlotPoint( x_axis.PixelsToPlot(x), y_axis.PixelsToPlot(y) );
3747}
3748
3749ImPlotPoint PixelsToPlot(const ImVec2& pix, ImAxis x_idx, ImAxis y_idx) {
3750 return PixelsToPlot(pix.x, pix.y, x_idx, y_idx);

Callers 4

GetPlotMousePosFunction · 0.85
GetPlotSelectionFunction · 0.85
DragRectFunction · 0.85
PlotTextFunction · 0.85

Calls 2

SetupLockFunction · 0.85
PixelsToPlotMethod · 0.80

Tested by

no test coverage detected