Fix: round animating collapsing header height to GUI

This commit is contained in:
Emil Ernerfeldt 2025-01-03 14:54:57 +01:00
parent 4784136fee
commit 7519ec7099
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ use crate::{
emath, epaint, pos2, remap, remap_clamp, vec2, Context, Id, InnerResponse, NumExt, Rect, emath, epaint, pos2, remap, remap_clamp, vec2, Context, Id, InnerResponse, NumExt, Rect,
Response, Sense, Stroke, TextStyle, TextWrapMode, Ui, Vec2, WidgetInfo, WidgetText, WidgetType, Response, Sense, Stroke, TextStyle, TextWrapMode, Ui, Vec2, WidgetInfo, WidgetText, WidgetType,
}; };
use emath::GuiRounding as _;
use epaint::Shape; use epaint::Shape;
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
@ -214,7 +215,7 @@ impl CollapsingState {
10.0 10.0
} else { } else {
let full_height = self.state.open_height.unwrap_or_default(); 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(); let mut clip_rect = child_ui.clip_rect();