Integration: font menu previews load through the GPU-limit-safe texture loader

#466 moves font_menu_body into font_menu.rs with its own preview cache, which calls
egui's load_texture directly; next's #393 routes every texture through
widgets::load_texture so one past the GPU's maximum side is scaled down instead of
crashing.
This commit is contained in:
aiongg
2026-10-12 12:27:29 +00:00
parent 22d428f747
commit bc413ef7e2
+1 -1
View File
@@ -232,7 +232,7 @@ fn preview(
}
let img = designcraft_render::glyphs::text_line(fonts, family, style, text, px, color.to_array());
let ci = egui::ColorImage::from_rgba_premultiplied([img.width as usize, img.height as usize], &img.pixels);
let t = ui.ctx().load_texture(format!("font_preview_{family}_{style}"), ci, egui::TextureOptions::LINEAR);
let t = crate::widgets::load_texture(ui.ctx(), format!("font_preview_{family}_{style}"), ci, egui::TextureOptions::LINEAR);
ui.data_mut(|d| d.get_temp_mut_or_default::<Previews>(cache_id).insert(key, t.clone()));
t
}