Skip to content

Commit

Permalink
Update context.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic committed Sep 17, 2024
1 parent 271bd0b commit 1afa389
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2418,15 +2418,12 @@ impl Context {

self.write(|ctx| {
let tessellation_options = ctx.memory.options.tessellation_options;
let texture_atlas = match ctx.fonts.get(&pixels_per_point.into()) {
Some(fonts) => fonts.texture_atlas(),
None => {
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()
}
let texture_atlas = if let Some(fonts) = ctx.fonts.get(&pixels_per_point.into()) { fonts.texture_atlas() } else {
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()
};
let (font_tex_size, prepared_discs) = {
let atlas = texture_atlas.lock();
Expand Down

0 comments on commit 1afa389

Please sign in to comment.