Просмотр исходного кода

Fixed canvas not updating when const values change

Krzysztof Krysiński 4 месяцев назад
Родитель
Сommit
fcb468973c
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      src/PixiEditor.ChangeableDocument/Changeables/Graph/InputProperty.cs

+ 12 - 0
src/PixiEditor.ChangeableDocument/Changeables/Graph/InputProperty.cs

@@ -221,6 +221,18 @@ public class InputProperty : IInputProperty
         {
         {
             hash.Add(cacheable.GetCacheHash());
             hash.Add(cacheable.GetCacheHash());
         }
         }
+        else if (Value is Delegate func && Connection == null)
+        {
+            try
+            {
+                var constant = func.DynamicInvoke(FuncContext.NoContext);
+                if (constant is ShaderExpressionVariable shaderExpression)
+                {
+                    hash.Add(shaderExpression.GetConstant());
+                }
+            }
+            catch { }
+        }
         else
         else
         {
         {
             hash.Add(Value?.GetHashCode() ?? 0);
             hash.Add(Value?.GetHashCode() ?? 0);