From 7519ec70996bdfb36babbbea3b958f9b2596bee5 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Jan 2025 14:54:57 +0100 Subject: [PATCH] Fix: round animating collapsing header height to GUI --- crates/egui/src/containers/collapsing_header.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/containers/collapsing_header.rs b/crates/egui/src/containers/collapsing_header.rs index d6a6c7fb..121daeac 100644 --- a/crates/egui/src/containers/collapsing_header.rs +++ b/crates/egui/src/containers/collapsing_header.rs @@ -4,6 +4,7 @@ use crate::{ emath, epaint, pos2, remap, remap_clamp, vec2, Context, Id, InnerResponse, NumExt, Rect, Response, Sense, Stroke, TextStyle, TextWrapMode, Ui, Vec2, WidgetInfo, WidgetText, WidgetType, }; +use emath::GuiRounding as _; use epaint::Shape; #[derive(Clone, Copy, Debug)] @@ -214,7 +215,7 @@ impl CollapsingState { 10.0 } else { let full_height = self.state.open_height.unwrap_or_default(); - remap_clamp(openness, 0.0..=1.0, 0.0..=full_height) + remap_clamp(openness, 0.0..=1.0, 0.0..=full_height).round_ui() }; let mut clip_rect = child_ui.clip_rect();