Browse Source

Loop over used functions in BuiltInFunctions.cs

CPKreuz 11 months ago
parent
commit
e1f85eb525

+ 4 - 16
src/PixiEditor.DrawingApi.Core/Shaders/Generation/BuiltInFunctions.cs

@@ -26,24 +26,12 @@ public class BuiltInFunctions
     {
         var builder = new StringBuilder();
 
-        AppendIf(HueToRgb);
-        AppendIf(RgbToHcv);
-        
-        AppendIf(HsvToRgb);
-        AppendIf(RgbToHsv);
-
-        AppendIf(HslToRgb);
-        AppendIf(RgbToHsl);
-        
-        return builder.ToString();
-
-        void AppendIf(IBuiltInFunction function)
+        foreach (var function in usedFunctions)
         {
-            if (usedFunctions.Contains(function))
-            {
-                builder.AppendLine(function.FullSource);
-            }
+            builder.AppendLine(function.FullSource);
         }
+
+        return builder.ToString();
     }
 
     private Expression Call(IBuiltInFunction function, Expression expression)