summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/math/mod.rs
diff options
context:
space:
mode:
authorLU Jialin <luxxxlucy@gmail.com>2023-09-11 16:46:39 +0800
committerGitHub <noreply@github.com>2023-09-11 10:46:39 +0200
commit71dccde031dedc285042257c7e16bafb152dde58 (patch)
tree9ca1f2c1acbde6af59e643b5457f0912cd606790 /crates/typst-library/src/math/mod.rs
parent09442d93eebf176e42d768cbe7b5c31d331dc907 (diff)
Provide `highlight` function for setting the background color of text (#2076)
Diffstat (limited to 'crates/typst-library/src/math/mod.rs')
-rw-r--r--crates/typst-library/src/math/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/typst-library/src/math/mod.rs b/crates/typst-library/src/math/mod.rs
index 40df524f..5d32af64 100644
--- a/crates/typst-library/src/math/mod.rs
+++ b/crates/typst-library/src/math/mod.rs
@@ -289,10 +289,11 @@ impl Layout for EquationElem {
frame.push_frame(Point::new(x, y), counter)
}
} else {
+ let font_size = TextElem::size_in(styles);
let slack = ParElem::leading_in(styles) * 0.7;
- let top_edge = TextElem::top_edge_in(styles).resolve(styles, &font, None);
+ let top_edge = TextElem::top_edge_in(styles).resolve(font_size, &font, None);
let bottom_edge =
- -TextElem::bottom_edge_in(styles).resolve(styles, &font, None);
+ -TextElem::bottom_edge_in(styles).resolve(font_size, &font, None);
let ascent = top_edge.max(frame.ascent() - slack);
let descent = bottom_edge.max(frame.descent() - slack);