Browse Source

Merge branch 'master' into fixes/always-send-exception_open-from-report

Krzysztof Krysiński 4 months ago
parent
commit
07b818c6f3

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 67e28c2a97d6002457875a3e81eb5c51ca8f4201
+Subproject commit 631c8e4cda079ae6872ff90ca2528bf6be09a69d

+ 3 - 3
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/CombineSeparate/SeparateColorNode.cs

@@ -56,13 +56,13 @@ public class SeparateColorNode : Node
         };
         };
 
 
     private Half4 GetRgba(FuncContext ctx) => 
     private Half4 GetRgba(FuncContext ctx) => 
-        contextVariables.GetOrAttachNew(ctx, Color, () => ctx.GetValue(Color));
+        ctx.HasContext ? contextVariables.GetOrAttachNew(ctx, Color, () => ctx.GetValue(Color)) : ctx.GetValue(Color);
 
 
     private Half4 GetHsva(FuncContext ctx) =>
     private Half4 GetHsva(FuncContext ctx) =>
-        contextVariables.GetOrAttachNew(ctx, Color, () => ctx.RgbaToHsva(ctx.GetValue(Color)));
+        ctx.HasContext ? contextVariables.GetOrAttachNew(ctx, Color, () => ctx.RgbaToHsva(ctx.GetValue(Color))) : ctx.RgbaToHsva(ctx.GetValue(Color));
 
 
     private Half4 GetHsla(FuncContext ctx) =>
     private Half4 GetHsla(FuncContext ctx) =>
-        contextVariables.GetOrAttachNew(ctx, Color, () => ctx.RgbaToHsla(ctx.GetValue(Color)));
+        ctx.HasContext ? contextVariables.GetOrAttachNew(ctx, Color, () => ctx.RgbaToHsla(ctx.GetValue(Color))) : ctx.RgbaToHsla(ctx.GetValue(Color));
 
 
     public override Node CreateCopy() => new SeparateColorNode();
     public override Node CreateCopy() => new SeparateColorNode();
 }
 }

+ 18 - 5
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/SampleImageNode.cs

@@ -30,21 +30,34 @@ public class SampleImageNode : Node
 
 
     private Half4 GetColor(FuncContext context)
     private Half4 GetColor(FuncContext context)
     {
     {
-        context.ThrowOnMissingContext();
-
         if (Image.Value is null)
         if (Image.Value is null)
         {
         {
             return new Half4("");
             return new Half4("");
         }
         }
 
 
-        Expression uv = context.GetValue(Coordinate);
+        if (context.HasContext)
+        {
+            Expression uv = context.GetValue(Coordinate);
+
+            return context.SampleSurface(Image.Value.DrawingSurface, uv, SampleMode.Value);
+        }
+
+        Color color;
+        VecI pixelCoordinate = (VecI)context.GetValue(Coordinate).ConstantValue.Round();
+        if (SampleMode.Value == ColorSampleMode.ColorManaged)
+        {
+            color = Image.Value.GetSRGBPixel(pixelCoordinate);
+        }
+        else
+        {
+            color = Image.Value.GetPixel(pixelCoordinate);
+        }
 
 
-        return context.SampleSurface(Image.Value.DrawingSurface, uv, SampleMode.Value);
+        return new Half4("") { ConstantValue = color };
     }
     }
 
 
     protected override void OnExecute(RenderContext context)
     protected override void OnExecute(RenderContext context)
     {
     {
-
     }
     }
 
 
     public override Node CreateCopy() => new SampleImageNode();
     public override Node CreateCopy() => new SampleImageNode();

+ 1 - 1
src/PixiEditor/Initialization/ClassicDesktopEntry.cs

@@ -61,7 +61,7 @@ internal class ClassicDesktopEntry
 
 
         InitOperatingSystem();
         InitOperatingSystem();
 
 
-        if (ParseArgument("--crash (\"?)([A-z0-9:\\/\\ -_.]+)\\1", arguments, out Group[] groups))
+        if (ParseArgument(@"--crash (""?)([\w:\/\ -_.]+)\1", arguments, out Group[] groups))
         {
         {
             try
             try
             {
             {

+ 2 - 2
src/PixiEditor/Properties/AssemblyInfo.cs

@@ -41,5 +41,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0.74")]
-[assembly: AssemblyFileVersion("2.0.0.74")]
+[assembly: AssemblyVersion("2.0.0.75")]
+[assembly: AssemblyFileVersion("2.0.0.75")]