♻️ Refactor panning/zoom rendering

This commit is contained in:
AzazelN28 2025-01-07 09:04:44 +01:00
parent a5b2f0e4c3
commit 10b32de447
7 changed files with 70 additions and 23 deletions

View file

@ -69,9 +69,16 @@ pub unsafe extern "C" fn render_without_cache() {
}
#[no_mangle]
pub unsafe extern "C" fn navigate() {
pub unsafe extern "C" fn zoom() {
let state: &mut Box<State<'_>> =
unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
state.zoom();
}
#[no_mangle]
pub unsafe extern "C" fn pan() {
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
state.navigate();
state.pan();
}
#[no_mangle]