Add stack of drawable areas

This lets the user restrict the drawable area to a sub-area of the
buffer. This lets the user draw without caring about the absolute
position, and guarantees that no glyphs or glyph parts appear outside of
the drawable area.
This commit is contained in:
Joscha 2022-07-13 10:38:26 +02:00
parent e4e1454e80
commit 14aedaf252
2 changed files with 105 additions and 11 deletions

View file

@ -26,6 +26,14 @@ impl Default for Frame {
}
impl Frame {
pub fn push(&mut self, pos: Pos, size: Size) {
self.buffer.push(pos, size);
}
pub fn pop(&mut self) {
self.buffer.pop();
}
pub fn size(&self) -> Size {
self.buffer.size()
}