| 3723 | } |
| 3724 | |
| 3725 | void SetAxes(ImAxis x_idx, ImAxis y_idx) { |
| 3726 | ImPlotContext& gp = *GImPlot; |
| 3727 | IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "SetAxes() needs to be called between BeginPlot() and EndPlot()!"); |
| 3728 | IM_ASSERT_USER_ERROR(x_idx >= ImAxis_X1 && x_idx < ImAxis_Y1, "X-Axis index out of bounds!"); |
| 3729 | IM_ASSERT_USER_ERROR(y_idx >= ImAxis_Y1 && y_idx < ImAxis_COUNT, "Y-Axis index out of bounds!"); |
| 3730 | IM_ASSERT_USER_ERROR(gp.CurrentPlot->Axes[x_idx].Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?"); |
| 3731 | IM_ASSERT_USER_ERROR(gp.CurrentPlot->Axes[y_idx].Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?"); |
| 3732 | SetupLock(); |
| 3733 | gp.CurrentPlot->CurrentX = x_idx; |
| 3734 | gp.CurrentPlot->CurrentY = y_idx; |
| 3735 | } |
| 3736 | |
| 3737 | ImPlotPoint PixelsToPlot(float x, float y, ImAxis x_idx, ImAxis y_idx) { |
| 3738 | ImPlotContext& gp = *GImPlot; |
no test coverage detected