pub struct Layer {
pub objc: ObjcProperty,
}
Expand description
Represents a CALayer
.
Each widget has an underlying layer
field that you can access, which offers additional
rendering tools.
// Create a rounded red box
use cacao::view::View;
use cacao::color::Color;
let view = View::default();
view.set_background_color(Color::SystemRed);
view.layer.set_corner_radius(4.0);
Fields
objc: ObjcProperty
The underlying layer pointer.
Implementations
sourceimpl Layer
impl Layer
sourcepub fn set_corner_radius(&self, radius: f64)
pub fn set_corner_radius(&self, radius: f64)
Sets the corner radius (for all four corners).
Note that for performance sensitive contexts, you might want to apply a mask instead.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Layer
impl !Send for Layer
impl !Sync for Layer
impl Unpin for Layer
impl !UnwindSafe for Layer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more