Add Background widget
This commit is contained in:
parent
1000de5bcf
commit
fd1b337cd1
4 changed files with 70 additions and 17 deletions
|
|
@ -22,16 +22,11 @@ impl<'a, C> View<'a, C> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn with_area(mut self, area: Rect) -> Self {
|
||||
self.area = area;
|
||||
pub fn zoom(mut self, area: Rect) -> Self {
|
||||
self.area = area + self.area.corner_nw();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn translated(self, delta: Vec2) -> Self {
|
||||
let area = self.area + delta;
|
||||
self.with_area(area)
|
||||
}
|
||||
|
||||
pub fn size(&self) -> Vec2 {
|
||||
self.area.size()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue