]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Correct the math min and max functions
authorCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 8 Jul 2009 09:40:02 +0000 (10:40 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 8 Jul 2009 09:40:02 +0000 (10:40 +0100)
Were the wrong way round and confusingly written. Also adds a MathPi constant.

src/plugins/splash/script/script-lib-math.script

index c90bba04bcb6067db26300cb1fb059840e92b358..d71b338bcb2b0ddea4982c0610d9011e944a6d65 100644 (file)
@@ -3,14 +3,14 @@ fun MathAbs (value){
     return value;
     }
 
-fun MathMin (value, min){
-    if (value < min) return min;
-    return value;
+fun MathMin (value_a, value_b){
+    if (value_a < value_b) return value_a;
+    return value_b;
     }
 
 fun MathMax (value, max){
-    if (value > max) return max;
-    return value;
+    if (value_a > value_a) return value_a;
+    return value_b;
     }
 
 fun MathClamp (value, min, max){
@@ -18,3 +18,6 @@ fun MathClamp (value, min, max){
     if (value > max) return max;
     return value;
     }
+
+
+MathPi = 3.14159265358979323846;