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:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
¤t_font_impl_metrics,
|
||||
glyph_info,
|
||||
chr,
|
||||
paragraph.cursor_x_px,
|
||||
),
|
||||
None => Default::default(),
|
||||
)
|
||||
} else {
|
||||
Default::default()
|
||||
};
|
||||
|
||||
paragraph.glyphs.push(Glyph {
|
||||
|
||||
Reference in New Issue
Block a user