Computes the maximum extent of tick labels perpendicular to the axis in screen space
| 994 | |
| 995 | // Computes the maximum extent of tick labels perpendicular to the axis in screen space |
| 996 | float ComputeMaxTickLabelExtent(const ImPlot3DAxis& axis) { |
| 997 | if (ImPlot3D::ImHasFlag(axis.Flags, ImPlot3DAxisFlags_NoTickLabels)) |
| 998 | return 0.0f; |
| 999 | |
| 1000 | // Tick labels are always rendered perpendicular to the axis (in the outward direction), |
| 1001 | // so LabelSize.x (the text advance width) fully contributes to the outward extent. |
| 1002 | float max_extent = 0.0f; |
| 1003 | for (int t = 0; t < axis.Ticker.TickCount(); ++t) { |
| 1004 | const ImPlot3DTick& tick = axis.Ticker.Ticks[t]; |
| 1005 | if (!tick.ShowLabel) |
| 1006 | continue; |
| 1007 | max_extent = ImMax(max_extent, tick.LabelSize.x * 0.5f); |
| 1008 | } |
| 1009 | |
| 1010 | return max_extent; |
| 1011 | } |
| 1012 | |
| 1013 | void RenderTickLabels(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DPoint* corners, const ImVec2* corners_pix, |
| 1014 | const int axis_corners[3][2]) { |
no test coverage detected