Skip to content

Commit

Permalink
Add doc-test of with_layer_id
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 30, 2024
1 parent 679f6f5 commit 656fd75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,16 @@ impl Ui {
}

/// Redirect shapes to another paint layer.
///
/// ```
/// # use egui::{LayerId, Order, Id};
/// # egui::__run_test_ui(|ui| {
/// let layer_id = LayerId::new(Order::Tooltip, Id::new("my_floating_ui"));
/// ui.with_layer_id(layer_id, |ui| {
/// ui.label("This is now in a different layer");
/// });
/// # });
/// ```
pub fn with_layer_id<R>(
&mut self,
layer_id: LayerId,
Expand Down

0 comments on commit 656fd75

Please sign in to comment.