mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Use ascent of the first font instead
This commit is contained in:
@@ -469,14 +469,10 @@ impl Font {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn ascent(&self) -> f32 {
|
pub(crate) fn ascent(&self) -> f32 {
|
||||||
if self.fonts.is_empty() {
|
if let Some(first) = self.fonts.first() {
|
||||||
self.row_height
|
first.ascent()
|
||||||
} else {
|
} else {
|
||||||
let mut max_ascent = 0.0;
|
self.row_height
|
||||||
for font in &self.fonts {
|
|
||||||
max_ascent = f32::max(max_ascent, font.ascent());
|
|
||||||
}
|
|
||||||
max_ascent
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user