Skip to content

Commit

Permalink
Replace clamp function with faster version
Browse files Browse the repository at this point in the history
Co-authored-by: auriafoxgirl <auriafoxgirl@users.noreply.github.com>
  • Loading branch information
UnlikePaladin and auriafoxgirl committed Oct 1, 2023
1 parent 9c35513 commit df2a434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/src/main/resources/assets/figura/scripts/math.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- math utils --

function math.clamp(val, min, max)
return math.min(math.max(val, min), max)
return min > max and max or val > max and max or val < min and min or val
end

function math.lerp(a, b, t)
Expand Down

0 comments on commit df2a434

Please sign in to comment.