mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Update utils.ts
This commit is contained in:
parent
09a05a4a1c
commit
028ad1ee81
1 changed files with 3 additions and 0 deletions
|
@ -140,9 +140,12 @@ export const throttleRAF = <T extends any[]>(
|
||||||
const scheduleFunc = (args: T) => {
|
const scheduleFunc = (args: T) => {
|
||||||
timerId = window.requestAnimationFrame(() => {
|
timerId = window.requestAnimationFrame(() => {
|
||||||
timerId = null;
|
timerId = null;
|
||||||
|
console.log("start render in animation frame");
|
||||||
fn(...args);
|
fn(...args);
|
||||||
|
console.log("render done in animation frame");
|
||||||
lastArgs = null;
|
lastArgs = null;
|
||||||
if (lastArgsTrailing) {
|
if (lastArgsTrailing) {
|
||||||
|
console.log("last args trailing", lastArgsTrailing);
|
||||||
lastArgs = lastArgsTrailing;
|
lastArgs = lastArgsTrailing;
|
||||||
lastArgsTrailing = null;
|
lastArgsTrailing = null;
|
||||||
scheduleFunc(lastArgs);
|
scheduleFunc(lastArgs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue