FIX SIZE CACHE

This commit is contained in:
2025-12-17 00:09:20 -05:00
parent ecbb9e56e2
commit 1363f31fcd
9 changed files with 144 additions and 178 deletions

18
core/src/ui/cache.rs Normal file
View File

@@ -0,0 +1,18 @@
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();
}
}