1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Remove "seconds_since_midnight" from epi/eframe. Use chrono instead

chrono works both natively and on web.

Related: https://github.com/emilk/egui/issues/212
This commit is contained in:
Emil Ernerfeldt
2021-10-19 15:37:20 +02:00
parent cdd4dccf5f
commit 844dd9d7a4
17 changed files with 27 additions and 64 deletions

View File

@@ -62,12 +62,6 @@ pub fn now_sec() -> f64 {
/ 1000.0
}
pub fn seconds_since_midnight() -> f64 {
let d = js_sys::Date::new_0();
let seconds = (d.get_hours() * 60 + d.get_minutes()) * 60 + d.get_seconds();
seconds as f64 + 1e-3 * (d.get_milliseconds() as f64)
}
pub fn screen_size_in_native_points() -> Option<egui::Vec2> {
let window = web_sys::window()?;
Some(egui::Vec2::new(