mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
17 lines
596 B
JavaScript
17 lines
596 B
JavaScript
addToLibrary({
|
|
wapi_requestAnimationFrame: function wapi_requestAnimationFrame() {
|
|
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
setTimeout(Module._process_animation_frame);
|
|
} else {
|
|
return window.requestAnimationFrame(Module._process_animation_frame);
|
|
}
|
|
},
|
|
wapi_cancelAnimationFrame: function wapi_cancelAnimationFrame(frameId) {
|
|
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
clearTimeout(frameId);
|
|
} else {
|
|
return window.cancelAnimationFrame(frameId);
|
|
}
|
|
}
|
|
});
|