pub type Stack = Stack<Layer>;
Aliased Type§
struct Stack { /* private fields */ }
Implementations
§impl<T> Stack<T>where
T: Layer,
impl<T> Stack<T>where
T: Layer,
pub fn new() -> Stack<T>
pub fn new() -> Stack<T>
Creates a new empty [Stack
].
pub 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
].
pub fn transformation(&self) -> Transformation
pub fn transformation(&self) -> Transformation
Returns the current [Transformation
] of the [Stack
].
pub 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.
pub 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.
pub 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
.
pub fn pop_transformation(&mut self)
pub fn pop_transformation(&mut self)
Pops the current [Transformation
] in the [Stack
].
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
Returns an iterator over mutable references to the layers in the [Stack
].
pub 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
].
pub fn flush(&mut self)
pub fn flush(&mut self)
Flushes and settles any primitives in the current layer of the [Stack
].
pub fn clear(&mut self)
pub fn clear(&mut self)
Clears the layers of the [Stack
], allowing reuse.
This will normally keep layer allocations for future drawing operations.