Merge pull request #5529 from penpot/azazeln28-refactor-panning-perf

♻️ Refactor panning perf
This commit is contained in:
Belén Albeza 2025-01-14 15:26:03 +01:00 committed by GitHub
commit 4d4bf1edd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 70 additions and 23 deletions

View file

@ -70,9 +70,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]