From 0b52813f62de5a46dfde4c891c5f2f169b0aa8e1 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 9 May 2021 10:09:05 +0200 Subject: [PATCH] Sort demo windows (multi-touch demo was out of order) --- egui_demo_lib/src/apps/demo/demo_windows.rs | 2 +- egui_demo_lib/src/apps/demo/mod.rs | 2 +- .../src/apps/demo/{zoom_rotate.rs => multi_touch.rs} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename egui_demo_lib/src/apps/demo/{zoom_rotate.rs => multi_touch.rs} (98%) diff --git a/egui_demo_lib/src/apps/demo/demo_windows.rs b/egui_demo_lib/src/apps/demo/demo_windows.rs index 24cdd4dc..5c00aab0 100644 --- a/egui_demo_lib/src/apps/demo/demo_windows.rs +++ b/egui_demo_lib/src/apps/demo/demo_windows.rs @@ -16,9 +16,9 @@ impl Default for Demos { let demos: Vec> = vec![ Box::new(super::dancing_strings::DancingStrings::default()), Box::new(super::drag_and_drop::DragAndDropDemo::default()), - Box::new(super::zoom_rotate::ZoomRotate::default()), Box::new(super::font_book::FontBook::default()), Box::new(super::DemoWindow::default()), + Box::new(super::multi_touch::MultiTouch::default()), Box::new(super::painting::Painting::default()), Box::new(super::plot_demo::PlotDemo::default()), Box::new(super::scrolling::Scrolling::default()), diff --git a/egui_demo_lib/src/apps/demo/mod.rs b/egui_demo_lib/src/apps/demo/mod.rs index 8d3cfe14..82614837 100644 --- a/egui_demo_lib/src/apps/demo/mod.rs +++ b/egui_demo_lib/src/apps/demo/mod.rs @@ -13,6 +13,7 @@ pub mod font_book; pub mod font_contents_emoji; pub mod font_contents_ubuntu; pub mod layout_test; +pub mod multi_touch; pub mod painting; pub mod password; pub mod plot_demo; @@ -23,7 +24,6 @@ pub mod toggle_switch; pub mod widget_gallery; mod widgets; pub mod window_options; -pub mod zoom_rotate; pub use {app::*, demo_window::DemoWindow, demo_windows::*, widgets::Widgets}; diff --git a/egui_demo_lib/src/apps/demo/zoom_rotate.rs b/egui_demo_lib/src/apps/demo/multi_touch.rs similarity index 98% rename from egui_demo_lib/src/apps/demo/zoom_rotate.rs rename to egui_demo_lib/src/apps/demo/multi_touch.rs index ecb52d4f..f1cbff7a 100644 --- a/egui_demo_lib/src/apps/demo/zoom_rotate.rs +++ b/egui_demo_lib/src/apps/demo/multi_touch.rs @@ -3,7 +3,7 @@ use egui::{ vec2, Color32, Frame, Pos2, Rect, Sense, Stroke, Vec2, }; -pub struct ZoomRotate { +pub struct MultiTouch { previous_arrow_start_offset: Vec2, rotation: f32, smoothed_velocity: Vec2, @@ -11,7 +11,7 @@ pub struct ZoomRotate { zoom: f32, } -impl Default for ZoomRotate { +impl Default for MultiTouch { fn default() -> Self { Self { previous_arrow_start_offset: Vec2::ZERO, @@ -23,7 +23,7 @@ impl Default for ZoomRotate { } } -impl super::Demo for ZoomRotate { +impl super::Demo for MultiTouch { fn name(&self) -> &'static str { "👌 Multi Touch" } @@ -40,7 +40,7 @@ impl super::Demo for ZoomRotate { } } -impl super::View for ZoomRotate { +impl super::View for MultiTouch { fn ui(&mut self, ui: &mut egui::Ui) { ui.vertical_centered(|ui| { ui.add(crate::__egui_github_link_file!());