Paint math limits above and below their base
This commit is contained in:
1 parent
b004cd2efb
commit
3f1dd0c077
2 files changed
+47
-1
No files matched your search
@@ -1837,6 +1837,26 @@ mod tests {
|
||||
assert!(svg.contains("font-style=\"italic\">face2"));
|
||||
assert!(svg.contains("font-family=\"monospace\">face3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_list_paints_limits_above_and_below() {
|
||||
let document = Document::new(
|
||||
1000,
|
||||
vec![Unit::math(
|
||||
1,
|
||||
crate::math::parse_math("\\sum_{i=1}^{n}"),
|
||||
&Cmr10Metrics::default(),
|
||||
)],
|
||||
);
|
||||
let engine = Engine::layout(&document);
|
||||
let list = engine.pages()[0].display_list();
|
||||
let texts = list
|
||||
.items
|
||||
.iter()
|
||||
.filter(|item| matches!(item, DisplayItem::Text { .. }))
|
||||
.count();
|
||||
assert!(texts >= 4, "expected sum plus both limits, got {texts}");
|
||||
}
|
||||
#[test]
|
||||
fn math_display_list_paints_symbols_and_fraction_rule() {
|
||||
let atom = crate::math::parse_math("x + \\frac{a}{b}");
|
||||
|
||||
Reference in new issue
Block a user