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

Function GetPlotSelection

src/external/imgui/implot.cpp:3762–3777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3760}
3761
3762ImPlotRect GetPlotSelection(ImAxis x_idx, ImAxis y_idx) {
3763 ImPlotContext& gp = *GImPlot;
3764 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "GetPlotSelection() needs to be called between BeginPlot() and EndPlot()!");
3765 SetupLock();
3766 ImPlotPlot& plot = *gp.CurrentPlot;
3767 if (!plot.Selected)
3768 return ImPlotRect(0,0,0,0);
3769 ImPlotPoint p1 = PixelsToPlot(plot.SelectRect.Min + plot.PlotRect.Min, x_idx, y_idx);
3770 ImPlotPoint p2 = PixelsToPlot(plot.SelectRect.Max + plot.PlotRect.Min, x_idx, y_idx);
3771 ImPlotRect result;
3772 result.X.Min = ImMin(p1.x, p2.x);
3773 result.X.Max = ImMax(p1.x, p2.x);
3774 result.Y.Min = ImMin(p1.y, p2.y);
3775 result.Y.Max = ImMax(p1.y, p2.y);
3776 return result;
3777}
3778
3779void CancelPlotSelection() {
3780 ImPlotContext& gp = *GImPlot;

Callers

nothing calls this directly

Calls 5

SetupLockFunction · 0.85
ImPlotRectClass · 0.85
PixelsToPlotFunction · 0.85
ImMinFunction · 0.85
ImMaxFunction · 0.85

Tested by

no test coverage detected