mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 07:03:14 -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 {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user