mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Merge branch 'lucas/malmal/with-visual-transform-no-scope' into lucas/malmal/main
This commit is contained in:
@@ -2969,10 +2969,12 @@ impl Ui {
|
|||||||
(InnerResponse { inner, response }, payload)
|
(InnerResponse { inner, response }, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new Scope and transform its contents via a [`emath::TSTransform`].
|
/// Transform the contents of this closure via a [`emath::TSTransform`].
|
||||||
/// This only affects visuals, inputs will not be transformed. So this is mostly useful
|
/// This only affects visuals, inputs will not be transformed. So this is mostly useful
|
||||||
/// to create visual effects on interactions, e.g. scaling a button on hover / click.
|
/// to create visual effects on interactions, e.g. scaling a button on hover / click.
|
||||||
///
|
///
|
||||||
|
/// This doesn't create a new scope, so it'll work fine within horizontal_wrapped layouts.
|
||||||
|
///
|
||||||
/// Check out [`Context::set_transform_layer`] for a persistent transform that also affects
|
/// Check out [`Context::set_transform_layer`] for a persistent transform that also affects
|
||||||
/// inputs.
|
/// inputs.
|
||||||
pub fn with_visual_transform<R>(
|
pub fn with_visual_transform<R>(
|
||||||
@@ -2985,7 +2987,7 @@ impl Ui {
|
|||||||
.map_or(crate::layers::ShapeIdx(0), |l| l.next_idx())
|
.map_or(crate::layers::ShapeIdx(0), |l| l.next_idx())
|
||||||
});
|
});
|
||||||
|
|
||||||
let r = self.scope_dyn(UiBuilder::new(), Box::new(add_contents));
|
add_contents(self);
|
||||||
|
|
||||||
self.ctx().graphics_mut(|g| {
|
self.ctx().graphics_mut(|g| {
|
||||||
let list = g.entry(self.layer_id());
|
let list = g.entry(self.layer_id());
|
||||||
|
|||||||
Reference in New Issue
Block a user