You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add vertical centering for operators and relations
- Add centerOperators flag to MathOptions (default: true) to vertically
center binary operators (+, -, ×, ÷) and relations (=, <, >, ≤, ≥)
relative to numbers at the math axis
- Add forceVariableBaseline flag for context-aware variable alignment:
- Variables adjacent to numbers (like '3x') stay at baseline
- Standalone variables (like 'x' in '3 + 5 = x') get centered
- Add alignment_utils.dart with KaTeX font metric calculations for
determining vertical offsets based on character heights/depths
- Add verticalOffset parameter to ResetDimension widget to enable
shifting characters vertically while maintaining baseline reporting
- Update shouldRebuildWidget in SymbolNode to respond to alignment
option changes
This improves visual alignment of math expressions, making operators
appear centered with numbers rather than sitting at the baseline.
Amp-Thread-ID: https://ampcode.com/threads/T-019b2f3b-eff3-74bb-bd05-6cddd682d980
Co-authored-by: Amp <amp@ampcode.com>
0 commit comments