macro goodness

This commit is contained in:
2025-12-15 23:11:32 -05:00
parent 0b8a93c5ce
commit 8d1a810483
9 changed files with 131 additions and 61 deletions

View File

@@ -52,7 +52,10 @@ pub trait HasUiState: Sized + 'static + HasUi {
fn ui_state(&mut self) -> &mut UiState<Self>;
fn ui_with_ui_state(&mut self) -> (&mut Ui<Self>, &mut UiState<Self>) {
// as long as you're not doing anything actually unhinged this should always work safely
(unsafe { std::mem::transmute(self.ui()) }, self.ui_state())
(
unsafe { std::mem::transmute::<&mut Ui<Self>, &mut Ui<Self>>(self.ui()) },
self.ui_state(),
)
}
}