| 3787 | } |
| 3788 | |
| 3789 | ImPlotRect GetPlotLimits(ImAxis x_idx, ImAxis y_idx) { |
| 3790 | ImPlotContext& gp = *GImPlot; |
| 3791 | IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "GetPlotLimits() needs to be called between BeginPlot() and EndPlot()!"); |
| 3792 | IM_ASSERT_USER_ERROR(x_idx == IMPLOT_AUTO || (x_idx >= ImAxis_X1 && x_idx < ImAxis_Y1), "X-Axis index out of bounds!"); |
| 3793 | IM_ASSERT_USER_ERROR(y_idx == IMPLOT_AUTO || (y_idx >= ImAxis_Y1 && y_idx < ImAxis_COUNT), "Y-Axis index out of bounds!"); |
| 3794 | SetupLock(); |
| 3795 | ImPlotPlot& plot = *gp.CurrentPlot; |
| 3796 | ImPlotAxis& x_axis = x_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentX] : plot.Axes[x_idx]; |
| 3797 | ImPlotAxis& y_axis = y_idx == IMPLOT_AUTO ? plot.Axes[plot.CurrentY] : plot.Axes[y_idx]; |
| 3798 | ImPlotRect limits; |
| 3799 | limits.X = x_axis.Range; |
| 3800 | limits.Y = y_axis.Range; |
| 3801 | return limits; |
| 3802 | } |
| 3803 | |
| 3804 | bool IsPlotHovered() { |
| 3805 | ImPlotContext& gp = *GImPlot; |
no test coverage detected