19 lines
388 B
Rust
19 lines
388 B
Rust
use crate::{BothAxis, Len, UiVec2, WidgetId, util::HashMap};
|
|
|
|
#[derive(Default)]
|
|
pub struct Cache {
|
|
pub size: BothAxis<HashMap<WidgetId, (UiVec2, Len)>>,
|
|
}
|
|
|
|
impl Cache {
|
|
pub fn remove(&mut self, id: WidgetId) {
|
|
self.size.x.remove(&id);
|
|
self.size.y.remove(&id);
|
|
}
|
|
|
|
pub fn clear(&mut self) {
|
|
self.size.x.clear();
|
|
self.size.y.clear();
|
|
}
|
|
}
|