mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30: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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user