Skip to content

Commit

Permalink
fix(reggresion): limit fps setting: max fps wasn't calculating correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Jan 4, 2024
1 parent 64bbb6e commit 9dd34f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export async function getScreenRefreshRate (): Promise<number> {
const fps = Math.floor(1000 * 10 / (DOMHighResTimeStamp - t0))

if (!callbackTriggered || fps > 1000) {
resolve(Math.max(fps, 1000)/* , DOMHighResTimeStampCollection */)
resolve(Math.min(fps, 1000)/* , DOMHighResTimeStampCollection */)
}

callbackTriggered = true
Expand Down

0 comments on commit 9dd34f6

Please sign in to comment.