Offset math scripts by the base italic correction
This commit is contained in:
1 parent
6a7e79fa03
commit
6dd4f6bf83
3 files changed
+34
-5
No files matched your search
@@ -567,12 +567,13 @@ impl Page {
|
||||
MathAtom::Script { base, sub, sup } => {
|
||||
let base_box = math::layout_math(base, font);
|
||||
Self::paint_math(base, font, x, baseline, size, list);
|
||||
let italic = math::italic_correction(base, font);
|
||||
let small = (size as f64 * 0.7) as i64;
|
||||
if let Some(sup) = sup {
|
||||
Self::paint_math(
|
||||
sup,
|
||||
font,
|
||||
x + base_box.width,
|
||||
x + base_box.width + italic,
|
||||
baseline - base_box.height * 2 / 3,
|
||||
small,
|
||||
list,
|
||||
@@ -582,7 +583,7 @@ impl Page {
|
||||
Self::paint_math(
|
||||
sub,
|
||||
font,
|
||||
x + base_box.width,
|
||||
x + base_box.width + italic,
|
||||
baseline + base_box.depth * 2 / 3,
|
||||
small,
|
||||
list,
|
||||
|
||||
Reference in new issue
Block a user