Skip to content

Commit 443dc3f

Browse files
committed
Fix clamp
Close #1
1 parent ee2c47c commit 443dc3f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ let dragging = -1;
119119
let highlighted = [0, 0, 0, 0];
120120

121121
function clamp(x, lo, hi) {
122+
if (isNaN(x)) return lo;
122123
return Math.min(Math.max(x, lo), hi);
123124
}
124125

0 commit comments

Comments
 (0)