From 196535ce84608449c9b95553f13cbeab456d55ee Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 16 Jul 2024 12:44:15 -0700 Subject: [PATCH] anim: add hover_expand_small I though I would need this, but I didn't end up using it. Keep it here anyways for now Signed-off-by: William Casarin --- src/ui/anim.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/anim.rs b/src/ui/anim.rs index 039241c2..9a8011cb 100644 --- a/src/ui/anim.rs +++ b/src/ui/anim.rs @@ -17,3 +17,11 @@ pub fn hover_expand( let size = size + val * expand_size; (rect, size, response) } + +pub fn hover_expand_small(ui: &mut egui::Ui, id: egui::Id) -> (egui::Rect, f32, egui::Response) { + let size = 10.0; + let expand_size = 5.0; + let anim_speed = 0.05; + + hover_expand(ui, id, size, expand_size, anim_speed) +}