From 61b53ae9378f8cc688ca2617f8cdf081ed14b0ac Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 16 Feb 2024 09:15:22 +0100 Subject: [PATCH] Improve error message when using wrong pixels_per_point in tessellate Closes https://github.com/emilk/egui/issues/4048 --- crates/egui/src/context.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index ea51532a..67bcb48f 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -2115,7 +2115,8 @@ impl Context { let texture_atlas = ctx .fonts .get(&pixels_per_point.into()) - .expect("tessellate called before first call to Context::run()") + .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.") .texture_atlas(); let (font_tex_size, prepared_discs) = { let atlas = texture_atlas.lock();