mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 07:56:10 +02:00
♻️ Refactor panning/zoom rendering
This commit is contained in:
parent
a5b2f0e4c3
commit
10b32de447
7 changed files with 70 additions and 23 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue