MCPcopy Create free account
hub / github.com/brenocq/implot3d / ComputeMaxTickLabelExtent

Function ComputeMaxTickLabelExtent

implot3d.cpp:996–1011  ·  view source on GitHub ↗

Computes the maximum extent of tick labels perpendicular to the axis in screen space

Source from the content-addressed store, hash-verified

994
995// Computes the maximum extent of tick labels perpendicular to the axis in screen space
996float 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
1013void RenderTickLabels(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DPoint* corners, const ImVec2* corners_pix,
1014 const int axis_corners[3][2]) {

Callers 3

ComputeAxisHoverWidthFunction · 0.85
RenderTickLabelsFunction · 0.85
RenderAxisLabelsFunction · 0.85

Calls 2

ImHasFlagFunction · 0.85
TickCountMethod · 0.80

Tested by

no test coverage detected