1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Small code cleanup

This commit is contained in:
Emil Ernerfeldt
2025-09-08 15:28:32 +02:00
parent 80c00dfb16
commit 5b3c80a2ff
2 changed files with 7 additions and 8 deletions

View File

@@ -231,10 +231,8 @@ impl FontImpl {
/// `\n` will result in `None`
pub(super) fn glyph_info(&mut self, c: char) -> Option<GlyphInfo> {
{
if let Some(glyph_info) = self.glyph_info_cache.get(&c) {
return Some(*glyph_info);
}
if let Some(glyph_info) = self.glyph_info_cache.get(&c) {
return Some(*glyph_info);
}
if self.ignore_character(c) {

View File

@@ -209,15 +209,16 @@ fn layout_section(
paragraph.cursor_x_px += extra_letter_spacing * pixels_per_point;
}
let (glyph_alloc, physical_x) = match font_impl.as_mut() {
Some(font_impl) => font_impl.allocate_glyph(
let (glyph_alloc, physical_x) = if let Some(font_impl) = font_impl.as_mut() {
font_impl.allocate_glyph(
font.atlas,
&current_font_impl_metrics,
glyph_info,
chr,
paragraph.cursor_x_px,
),
None => Default::default(),
)
} else {
Default::default()
};
paragraph.glyphs.push(Glyph {