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:
parent
e4e1454e80
commit
14aedaf252
2 changed files with 105 additions and 11 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue