diff options
author | Emil Ernerfeldt <emil.ernerfeldt@gmail.com> | 2024-09-19 14:41:18 +0200 |
---|---|---|
committer | Emil Ernerfeldt <emil.ernerfeldt@gmail.com> | 2024-09-19 14:41:18 +0200 |
commit | 5cc35d22127be4dbe58c2f7f80340c3d041094e9 (patch) | |
tree | 964424509abb6882835994a9a8166550465456fd | |
parent | 00cb50ebadc0dae076eb74cbaf9cd8400d1420a0 (diff) |
Improve docstring of `Ui::new_child`
-rw-r--r-- | crates/egui/src/ui.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index 68debcb3..dcd1a511 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -222,6 +222,14 @@ impl Ui { } /// Create a child `Ui` with the properties of the given builder. + /// + /// This is a very low-level function. + /// Usually you are better off using [`Self::scope_builder`]. + /// + /// Note that calling this does not allocate any space in the parent `Ui`, + /// so after adding widgets to the child `Ui` you probably want to allocate + /// the [`Ui::min_rect`] of the child in the parent `Ui` using e.g. + /// [`Ui::advance_cursor_after_rect`]. pub fn new_child(&mut self, ui_builder: UiBuilder) -> Self { let UiBuilder { id_salt, |