MCPcopy Create free account
hub / github.com/clementgallet/libTAS / PixelsToPlot

Function PixelsToPlot

src/external/imgui/implot.cpp:3668–3678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3666}
3667
3668ImPlotPoint PixelsToPlot(float x, float y, ImAxis x_idx, ImAxis y_idx) {
3669 ImPlotContext& gp = *GImPlot;
3670 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "PixelsToPlot() needs to be called between BeginPlot() and EndPlot()!");
3671 IM_ASSERT_USER_ERROR(x_idx == IMPLOT_AUTO || (x_idx >= ImAxis_X1 && x_idx < ImAxis_Y1), "X-Axis index out of bounds!");
3672 IM_ASSERT_USER_ERROR(y_idx == IMPLOT_AUTO || (y_idx >= ImAxis_Y1 && y_idx < ImAxis_COUNT), "Y-Axis index out of bounds!");
3673 SetupLock();
3674 ImPlotPlot& plot = *gp.CurrentPlot;
3675 ImPlotAxis& x_axis = x_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentX] : plot.Axes[x_idx];
3676 ImPlotAxis& y_axis = y_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentY] : plot.Axes[y_idx];
3677 return ImPlotPoint( x_axis.PixelsToPlot(x), y_axis.PixelsToPlot(y) );
3678}
3679
3680ImPlotPoint PixelsToPlot(const ImVec2& pix, ImAxis x_idx, ImAxis y_idx) {
3681 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 3

SetupLockFunction · 0.85
ImPlotPointFunction · 0.85
PixelsToPlotMethod · 0.80

Tested by

no test coverage detected