1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

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

View File

@@ -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();