Skip to content

Commit

Permalink
fix: fix the error of calcuating timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Aug 3, 2023
1 parent 0d5f61c commit b7e243e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "perf: enhance the effect of requestAnimationFrame in miniapp",
"type": "patch"
}
],
"packageName": "@visactor/vrender"
}
2 changes: 1 addition & 1 deletion packages/vrender/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export class RafBasedSTO {
this.durations.shift();
}
// 最多60fps
this.timeout = Math.min(this.durations.reduce((a, b) => a + b, 0) / this.durations.length, 1000 / 60);
this.timeout = Math.max(this.durations.reduce((a, b) => a + b, 0) / this.durations.length, 1000 / 60);
}
}

Expand Down

0 comments on commit b7e243e

Please sign in to comment.