]> git.lyx.org Git - features.git/commit
Implement display of roots more faithfully
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 4 Dec 2017 09:44:49 +0000 (10:44 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 4 Dec 2017 09:58:08 +0000 (10:58 +0100)
commit16af6e7c5067fff0873587af30833e0b8006c435
tree4bb31fd94904ca86695a77c94db9c3e43c7e54f8
parent83f214d636bff1c7eee6b99eb3293f064591429a
Implement display of roots more faithfully

This is a follow-up to 758de957.

- unify the metrics and drawing of \sqrt and \root using helper
  functions mathed_root_metrics and mathed_draw_root.

- compute the vertical spacing above the nucleus of the root following
  rule 11 of the TeXbook. In particular, it is different in inline and
  display style.

- draw the root glyph without hard-coded pixel values. Make the line
  width depend on the zoom.

more work is needed to implement properly rule 11:

- Ideally, we should use sqrt glyphs from the math fonts. Note that
  then we would get rule thickness from there.

- The positioning of the root MathData is arbitrary. It should
  follow the definition of \root...\of... in The Texbook in
  Apprendix B page 360.

Fixes bug #10814.
src/mathed/InsetMathRoot.cpp
src/mathed/InsetMathRoot.h
src/mathed/InsetMathSqrt.cpp
src/mathed/MathSupport.cpp
src/mathed/MathSupport.h