diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-02 19:50:14 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-02 19:50:14 +0100 |
| commit | 3f85d005bb5f343bb32a86d663f5dcfeef27f38a (patch) | |
| tree | 1349c139b22911e52e92eaf5c088ca1c29221f6e /library/src/math | |
| parent | 10675cd6d510521715c5e33508d80c4193ad9d74 (diff) | |
Fix root index placement again
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/root.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/library/src/math/root.rs b/library/src/math/root.rs index e1c8d987..fa41167d 100644 --- a/library/src/math/root.rs +++ b/library/src/math/root.rs @@ -1,7 +1,5 @@ use super::*; -const MIN_INDEX_SHIFT: Em = Em::new(0.35); - /// # Square Root /// A square root. /// @@ -123,12 +121,12 @@ fn layout( let inner_ascent = extra_ascender + thickness + gap + radicand.ascent(); let mut sqrt_offset = Abs::zero(); + let mut shift_up = Abs::zero(); let mut ascent = inner_ascent; - let mut shift_up = raise_factor * sqrt.height() - descent; if let Some(index) = &index { sqrt_offset = kern_before + index.width() + kern_after; - shift_up.set_max(index.descent() + MIN_INDEX_SHIFT.scaled(ctx)); + shift_up = raise_factor * sqrt.height() - descent + index.descent(); ascent.set_max(shift_up + index.ascent()); } |
