mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 10:08:06 +02:00
[script] Add simple Math functions (abs, min, max and clamp)
This commit is contained in:
parent
76666c2955
commit
4a6ba0212e
1 changed files with 20 additions and 1 deletions
|
|
@ -1 +1,20 @@
|
|||
|
||||
fun MathAbs (value){
|
||||
if (value < 0) return -value;
|
||||
return value;
|
||||
}
|
||||
|
||||
fun MathMin (value, min){
|
||||
if (value < min) return min;
|
||||
return value;
|
||||
}
|
||||
|
||||
fun MathMax (value, max){
|
||||
if (value > max) return max;
|
||||
return value;
|
||||
}
|
||||
|
||||
fun MathClamp (value, min, max){
|
||||
if (value < min) return min;
|
||||
if (value > max) return max;
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue