Skip to content

Commit

Permalink
Update context.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Sep 17, 2024
1 parent 1c9edff commit d9fd9c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2419,14 +2419,16 @@ impl Context {
self.write(|ctx| {
let tessellation_options = ctx.memory.options.tessellation_options;
let texture_atlas = if let Some(fonts) = ctx.fonts.get(&pixels_per_point.into()) {
fonts.texture_atlas()
} else {
fonts.texture_atlas()
} else {
#[cfg(feature = "log")]
log::warn!("No font size matching {pixels_per_point} pixels per point found.");
ctx.fonts.iter().next()
.expect("tessellate called with a different pixels_per_point than the font atlas was created with. \
You should use egui::FullOutput::pixels_per_point when tessellating.")
.1.texture_atlas()
ctx.fonts
.iter()
.next()
.expect("No fonts loaded")
.1
.texture_atlas()
};
let (font_tex_size, prepared_discs) = {
let atlas = texture_atlas.lock();
Expand Down

0 comments on commit d9fd9c5

Please sign in to comment.