Use ascent of the first font instead

This commit is contained in:
Emil Ernerfeldt
2024-09-19 08:36:18 +02:00
parent f051f96b73
commit 1398ff5678
+3 -7
View File
@@ -469,14 +469,10 @@ impl Font {
}
pub(crate) fn ascent(&self) -> f32 {
if self.fonts.is_empty() {
self.row_height
if let Some(first) = self.fonts.first() {
first.ascent()
} else {
let mut max_ascent = 0.0;
for font in &self.fonts {
max_ascent = f32::max(max_ascent, font.ascent());
}
max_ascent
self.row_height
}
}