Paint sqrt degrees before the radical
This commit is contained in:
1 parent
17d41cbffd
commit
0446a35b8c
2 files changed
+51
-4
No files matched your search
@@ -574,18 +574,25 @@ impl Page {
|
||||
height: 26_214,
|
||||
});
|
||||
}
|
||||
MathAtom::Sqrt { radicand, .. } => {
|
||||
MathAtom::Sqrt { radicand, degree } => {
|
||||
let box_ = math::layout_math(radicand, font);
|
||||
let small = (size as f64 * 0.7) as i64;
|
||||
let mut radical_x = x;
|
||||
if let Some(degree) = degree {
|
||||
let degree_box = math::layout_math(degree, font);
|
||||
Self::paint_math(degree, font, x, baseline - box_.height - small, small, list);
|
||||
radical_x += degree_box.width;
|
||||
}
|
||||
list.push(DisplayItem::Text {
|
||||
font: FontFace::Roman,
|
||||
x,
|
||||
x: radical_x,
|
||||
y: baseline,
|
||||
size,
|
||||
text: "√".to_string(),
|
||||
});
|
||||
Self::paint_math(radicand, font, x + 4 * 65_536, baseline, size, list);
|
||||
Self::paint_math(radicand, font, radical_x + 4 * 65_536, baseline, size, list);
|
||||
list.push(DisplayItem::Rule {
|
||||
x: x + 4 * 65_536,
|
||||
x: radical_x + 4 * 65_536,
|
||||
y: baseline - box_.height - 65_536,
|
||||
width: box_.width,
|
||||
height: 26_214,
|
||||
|
||||
Reference in new issue
Block a user