Add Block widget

This commit is contained in:
Joscha 2024-03-09 00:52:14 +01:00
parent e31eea8178
commit 2c8f9685b9
7 changed files with 131 additions and 6 deletions

View file

@ -31,6 +31,10 @@ impl<'a> View<'a> {
self.area.size()
}
pub fn area(&self) -> Rect {
Rect::from_nw(Vec2::ZERO, self.size())
}
fn pos_to_buffer_pos(&self, pos: Vec2) -> Vec2 {
pos + self.area.corner_nw()
}