1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Make sure native_pixels_per_point is set during app creation (#7683)

Useful for things like analytics
This commit is contained in:
Emil Ernerfeldt
2025-11-05 10:35:57 +01:00
committed by GitHub
parent 706ce10abd
commit 31d313572b
3 changed files with 40 additions and 7 deletions

View File

@@ -65,6 +65,14 @@ impl AppRunner {
o.zoom_factor = 1.0;
});
// Tell egui right away about native_pixels_per_point
// so that the app knows about it during app creation:
egui_ctx.input_mut(|i| {
let viewport_info = i.raw.viewports.entry(egui::ViewportId::ROOT).or_default();
viewport_info.native_pixels_per_point = Some(super::native_pixels_per_point());
i.pixels_per_point = super::native_pixels_per_point();
});
let cc = epi::CreationContext {
egui_ctx: egui_ctx.clone(),
integration_info: info.clone(),