1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Rename Fonts::end_frame to Fonts::prune_cache

This commit is contained in:
Emil Ernerfeldt
2021-11-03 22:23:52 +01:00
parent d8519b3281
commit 66eb2fb5f7
2 changed files with 5 additions and 5 deletions

View File

@@ -398,8 +398,8 @@ impl Fonts {
}
/// Must be called once per frame to clear the [`Galley`] cache.
pub fn end_frame(&self) {
self.galley_cache.lock().end_frame();
pub fn prune_cache(&self) {
self.galley_cache.lock().prune();
}
}
@@ -453,8 +453,8 @@ impl GalleyCache {
self.cache.len()
}
/// Must be called once per frame to clear the [`Galley`] cache.
pub fn end_frame(&mut self) {
/// Must be called once per frame to prune the [`Galley`] cache.
pub fn prune(&mut self) {
let current_generation = self.generation;
self.cache.retain(|_key, cached| {
cached.last_used == current_generation // only keep those that were used this frame