Skip to content

Commit

Permalink
Revert "fix: improve typing pixel ratio handling in setPixelRatio uti…
Browse files Browse the repository at this point in the history
…lity" (#929)

This reverts commit 790bbe8.
  • Loading branch information
alvarosabu authored Feb 10, 2025
1 parent 3e17e68 commit 9e76010
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,9 @@ export function setPixelRatio(renderer: { setPixelRatio?: (dpr: number) => void,

let newDpr = 0

if (userDpr && is.arr(userDpr)) {
const dprArray = userDpr as [number, number]
if (dprArray.length >= 2) {
const [min, max] = dprArray
newDpr = MathUtils.clamp(systemDpr, min, max)
}
if (userDpr && is.arr(userDpr) && userDpr.length >= 2) {
const [min, max] = userDpr
newDpr = MathUtils.clamp(systemDpr, min, max)
}
else if (is.num(userDpr)) { newDpr = userDpr }
else { newDpr = systemDpr }
Expand Down

0 comments on commit 9e76010

Please sign in to comment.