1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 07:03:14 -04:00
This commit is contained in:
Emil Ernerfeldt
2023-01-26 14:59:48 +01:00
parent f0d5b645f2
commit 9ad5356cfa
2 changed files with 4 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ impl Painter {
/// Redirect where you are painting.
#[must_use]
pub fn with_layer(self, z_layer: ZLayer) -> Self {
pub fn with_z_layer(self, z_layer: ZLayer) -> Self {
Self {
ctx: self.ctx,
z_layer,
@@ -56,14 +56,14 @@ impl Painter {
/// Redirect where you are painting with default z-index
#[must_use]
pub fn with_layer_id(self, layer: AreaLayerId) -> Self {
self.with_layer(ZLayer::from_area_layer(layer))
self.with_z_layer(ZLayer::from_area_layer(layer))
}
/// Redirect z-index
#[must_use]
pub fn with_z(self, z: ZOrder) -> Self {
let layer = self.z_layer.area_layer.with_z(z);
self.with_layer(layer)
self.with_z_layer(layer)
}
/// Create a painter for a sub-region of this [`Painter`].

View File

@@ -1770,7 +1770,7 @@ impl Ui {
}
/// Set z-index and layer id at the same time
pub fn with_layer<R>(
pub fn with_z_layer<R>(
&mut self,
layer: ZLayer,
add_contents: impl FnOnce(&mut Self) -> R,