Removed generated files, added cache clearing in debug

This commit is contained in:
elvis
2025-10-21 10:04:35 +02:00
parent f1ace24797
commit c3a8941baf
7 changed files with 52 additions and 1813 deletions

View File

@ -649,6 +649,12 @@ impl OutputsCache {
self.invalidate_cache(&output_id);
}
}
#[allow(dead_code)]
pub fn reset_cache(&mut self) {
let mut internals = self.internals.write().unwrap();
*internals = CacheInternals::default();
}
}
/// The graph 'global' state.
@ -1255,6 +1261,30 @@ impl eframe::App for AppHandle {
}
});
}
#[cfg(debug_assertions)]
{
use eframe::egui::{PopupCloseBehavior, RectAlign};
let response = egui::Frame::group(ui.style())
.show(ui, |ui| {
ui.set_max_height(20.);
ui.set_max_width(40.);
ui.vertical_centered(|ui| ui.button("Cache")).inner
})
.inner;
egui::Popup::menu(&response)
.align(RectAlign::BOTTOM_END)
.gap(4.)
.close_behavior(PopupCloseBehavior::CloseOnClickOutside)
.id(egui::Id::new("cache"))
.show(|ui| {
if ui.button("Clear").clicked() {
self.user_state.cache.reset_cache();
ui.close();
}
});
}
});
});