getAxisHeight static method
Gets the Math Axis height of the current font. The Math Axis is the reference line for vertically centering fraction lines and operators (like +).
Algorithm: Measures the minus sign '-', its vertical center is the math axis. Results are cached by (fontSize, provider) to avoid repeat measurements in the same render cycle.
Returns the math axis offset relative to the baseline (positive is upward).
Implementation
static double getAxisHeight(RenderContext context) {
final double fontSizePx = context.fontSize;
final int providerHash = context.mathFontProvider?.hashCode ?? 0;
final key = _cacheKey(fontSizePx, providerHash);
if (_axisHeightCache.containsKey(key)) {
return _axisHeightCache[key]!;
}
final double result = _computeAxisHeight(fontSizePx, context);
_axisHeightCache[key] = result;
return result;
}