From 24526d138daab40ce47a5cdbc851dd359e4f4e14 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 25 May 2022 12:10:23 -0400 Subject: [PATCH] widgets_ontop: return InnerResponse --- src/widgets.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets.rs b/src/widgets.rs index 5df6919..21539c7 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -1,12 +1,14 @@ +use egui::InnerResponse; use std::hash::Hash; +/// Creates an area ontop of a widget with an y offset pub fn widgets_ontop( ui: &egui::Ui, id: impl Hash, re: &egui::Response, y_offset: f32, add_contents: impl FnOnce(&mut egui::Ui) -> R, -) -> R { +) -> InnerResponse { let area = egui::Area::new(id) .fixed_pos(re.rect.min.offset_y(y_offset)) .order(egui::Order::Foreground); - area.show(ui.ctx(), |ui| add_contents(ui)).inner + area.show(ui.ctx(), |ui| add_contents(ui)) }