pub struct Stack<T: Layer> { /* private fields */ }Expand description
A stack of layers used for drawing.
Implementations§
Source§impl<T: Layer> Stack<T>
impl<T: Layer> Stack<T>
Sourcepub fn current_mut(&mut self) -> (&mut T, Transformation)
pub fn current_mut(&mut self) -> (&mut T, Transformation)
Returns a mutable reference to the current Layer of the Stack, together with
the current Transformation.
Sourcepub fn transformation(&self) -> Transformation
pub fn transformation(&self) -> Transformation
Returns the current Transformation of the Stack.
Sourcepub fn push_clip(&mut self, bounds: Rectangle)
pub fn push_clip(&mut self, bounds: Rectangle)
Pushes a new clipping region in the Stack; creating a new layer in the
process.
Sourcepub fn pop_clip(&mut self)
pub fn pop_clip(&mut self)
Pops the current clipping region from the Stack and restores the previous one.
The current layer will be recorded for drawing.
Sourcepub fn push_transformation(&mut self, transformation: Transformation)
pub fn push_transformation(&mut self, transformation: Transformation)
Pushes a new Transformation in the Stack.
Future drawing operations will be affected by this new Transformation until
it is popped using pop_transformation.
Sourcepub fn pop_transformation(&mut self)
pub fn pop_transformation(&mut self)
Pops the current Transformation in the Stack.
Sourcepub fn iter(&self) -> impl Iterator<Item = &T>
pub fn iter(&self) -> impl Iterator<Item = &T>
Returns an iterator over immutable references to the layers in the Stack.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>where
T: RefUnwindSafe,
impl<T> Send for Stack<T>where
T: Send,
impl<T> Sync for Stack<T>where
T: Sync,
impl<T> Unpin for Stack<T>where
T: Unpin,
impl<T> UnsafeUnpin for Stack<T>
impl<T> UnwindSafe for Stack<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more