pub trait EffectExt: Sized {
// Required method
fn get_effect(&mut self) -> &mut EffectData;
// Provided methods
fn effect(self, effect: EffectData) -> Self { ... }
fn overflow(self, overflow: impl Into<Overflow>) -> Self { ... }
fn blur(self, blur: impl Into<f32>) -> Self { ... }
fn rotation(self, rotation: impl Into<f32>) -> Self { ... }
fn opacity(self, opacity: impl Into<f32>) -> Self { ... }
fn scale(self, scale: impl Into<Scale>) -> Self { ... }
fn transform_origin(
self,
transform_origin: impl Into<TransformOrigin>,
) -> Self { ... }
}Expand description
Methods for visual effects applied to an element: clipping, blur, rotation, opacity and scale.
Required Methods§
Sourcefn get_effect(&mut self) -> &mut EffectData
fn get_effect(&mut self) -> &mut EffectData
Returns a mutable reference to the element’s effect data.
Provided Methods§
Sourcefn effect(self, effect: EffectData) -> Self
fn effect(self, effect: EffectData) -> Self
Replace all of the element’s effect data at once. See EffectData.
Sourcefn overflow(self, overflow: impl Into<Overflow>) -> Self
fn overflow(self, overflow: impl Into<Overflow>) -> Self
Set whether content overflowing the element’s bounds is clipped. See Overflow.
Sourcefn blur(self, blur: impl Into<f32>) -> Self
fn blur(self, blur: impl Into<f32>) -> Self
Apply a gaussian blur of the given radius to the element.
Sourcefn rotation(self, rotation: impl Into<f32>) -> Self
fn rotation(self, rotation: impl Into<f32>) -> Self
Rotate the element by the given angle in degrees.
Sourcefn opacity(self, opacity: impl Into<f32>) -> Self
fn opacity(self, opacity: impl Into<f32>) -> Self
Set the element’s opacity, from 0.0 (transparent) to 1.0 (opaque).
Sourcefn transform_origin(self, transform_origin: impl Into<TransformOrigin>) -> Self
fn transform_origin(self, transform_origin: impl Into<TransformOrigin>) -> Self
Set the point that the scale and rotation effects pivot around.
Defaults to the element’s center.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.