mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Fixed the problem that cause a break in time space
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::time::Instant;
|
||||
|
||||
use winit::event_loop::EventLoopWindowTarget;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -325,6 +327,7 @@ pub fn create_storage(_app_name: &str) -> Option<Box<dyn epi::Storage>> {
|
||||
pub struct EpiIntegration {
|
||||
pub frame: epi::Frame,
|
||||
last_auto_save: std::time::Instant,
|
||||
pub beagining: Instant,
|
||||
pub egui_ctx: egui::Context,
|
||||
pending_full_output: egui::FullOutput,
|
||||
/// When set, it is time to close the native window.
|
||||
@@ -396,6 +399,7 @@ impl EpiIntegration {
|
||||
window_state,
|
||||
follow_system_theme: native_options.follow_system_theme,
|
||||
app_icon_setter,
|
||||
beagining: Instant::now(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +503,8 @@ impl EpiIntegration {
|
||||
|
||||
self.frame.info.window_info =
|
||||
read_window_info(window, self.egui_ctx.pixels_per_point(), &self.window_state);
|
||||
let raw_input = egui_winit.take_egui_input(window);
|
||||
let mut raw_input = egui_winit.take_egui_input(window);
|
||||
raw_input.time = Some(self.beagining.elapsed().as_secs_f64());
|
||||
|
||||
// Run user code:
|
||||
let full_output = self.egui_ctx.run(raw_input, |egui_ctx| {
|
||||
|
||||
Reference in New Issue
Block a user