Jelajahi Sumber

Merge pull request #1083 from PixiEditor/fixes/14.08.25

Fixes bag
Krzysztof Krysiński 4 minggu lalu
induk
melakukan
7f9f852d11

+ 1 - 1
src/ColorPicker

@@ -1 +1 @@
-Subproject commit db8aaff273239b21bf4c6f99b0162dcd1d742533
+Subproject commit bf83dee60fda714c94024212948a1ff5ed40d438

+ 1 - 1
src/Directory.Build.props

@@ -1,7 +1,7 @@
 <Project>
     <PropertyGroup>
         <CodeAnalysisRuleSet>../Custom.ruleset</CodeAnalysisRuleSet>
-		    <AvaloniaVersion>11.3.0</AvaloniaVersion>
+		    <AvaloniaVersion>11.3.3</AvaloniaVersion>
     </PropertyGroup>
     <ItemGroup>
         <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 46be7a7eb2a93fc0fade23c8dcca20558209be6f
+Subproject commit bd34e239887d69235d18f0f95abdf80f94534b5d

+ 1 - 1
src/PixiDocks

@@ -1 +1 @@
-Subproject commit 87c3164a739b529dbbce199a7af761cbd11e5a58
+Subproject commit cb36e5ed4b61b99d52461e353d009ef52cb7d97b

+ 1 - 1
src/PixiEditor.AnimationRenderer.FFmpeg/FFMpegRenderer.cs

@@ -24,7 +24,7 @@ public class FFMpegRenderer : IAnimationRenderer
     {
         string path = $"ThirdParty/{IOperatingSystem.Current.Name}/ffmpeg";
 
-        string binaryPath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), path);
+        string binaryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), path);
 
         GlobalFFOptions.Configure(new FFOptions() { BinaryFolder = binaryPath });
 

+ 2 - 2
src/PixiEditor.AnimationRenderer.FFmpeg/PixiEditor.AnimationRenderer.FFmpeg.csproj

@@ -32,13 +32,13 @@
   </ItemGroup>
 
   <ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64'">
-    <Content Include="ThirdParty\MacOS\ffmpeg\**">
+    <Content Include="ThirdParty/MacOS/ffmpeg/**">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>
 
   <ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">
-    <Content Include="ThirdParty\MacOS\ffmpeg\**">
+    <Content Include="ThirdParty/MacOS/ffmpeg/**">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>

+ 6 - 3
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/BlurNode.cs

@@ -2,6 +2,7 @@
 using Drawie.Backend.Core.Surfaces;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -11,16 +12,18 @@ public class BlurNode : FilterNode
     public InputProperty<bool> PreserveAlpha { get; }
     
     public InputProperty<VecD> Radius { get; }
-    
+
+    protected override bool ExecuteOnlyOnCacheChange => true;
+
     public BlurNode()
     {
         PreserveAlpha = CreateInput("PreserveAlpha", "PRESERVE_ALPHA", true);
         Radius = CreateInput("Radius", "RADIUS", new VecD(1, 1)).WithRules(x => x.Min(new VecD(0, 0)));
     }
 
-    protected override ImageFilter GetImageFilter()
+    protected override ImageFilter? GetImageFilter(RenderContext context)
     {
-        var sigma = (VecF)Radius.Value;
+        var sigma = (VecF)(Radius.Value * context.ChunkResolution.Multiplier());
         var preserveAlpha = PreserveAlpha.Value;
 
         var xFilter = GetGaussianFilter(sigma.X, true, preserveAlpha, null, out float[] xKernel);

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/ColorAdjustmentsFilterNode.cs

@@ -1,5 +1,6 @@
 using Drawie.Backend.Core.ColorsImpl;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -54,7 +55,7 @@ public class ColorAdjustmentsFilterNode : FilterNode
             .WithRules(rules => rules.Min(-180d).Max(180d));
     }
 
-    protected override ColorFilter? GetColorFilter()
+    protected override ColorFilter? GetColorFilter(RenderContext context)
     {
         filters.ForEach(filter => filter.Dispose());
         filters.Clear();

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/ColorMatrixFilterNode.cs

@@ -1,6 +1,7 @@
 using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -17,7 +18,7 @@ public class ColorMatrixFilterNode : FilterNode
         Matrix = CreateInput(nameof(Matrix), "MATRIX", ColorMatrix.Identity);
     }
 
-    protected override ColorFilter? GetColorFilter()
+    protected override ColorFilter? GetColorFilter(RenderContext context)
     {
         if (Matrix.Value.Equals(lastMatrix))
         {

+ 4 - 4
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/FilterNode.cs

@@ -20,8 +20,8 @@ public abstract class FilterNode : Node
 
     protected override void OnExecute(RenderContext context)
     {
-        var colorFilter = GetColorFilter();
-        var imageFilter = GetImageFilter();
+        var colorFilter = GetColorFilter(context);
+        var imageFilter = GetImageFilter(context);
 
         if (colorFilter == null && imageFilter == null)
         {
@@ -34,7 +34,7 @@ public abstract class FilterNode : Node
         Output.Value = filter == null ? new Filter(colorFilter, imageFilter) : filter.Add(colorFilter, imageFilter);
     }
 
-    protected virtual ColorFilter? GetColorFilter() => null;
+    protected virtual ColorFilter? GetColorFilter(RenderContext context) => null;
 
-    protected virtual ImageFilter? GetImageFilter() => null;
+    protected virtual ImageFilter? GetImageFilter(RenderContext context) => null;
 }

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/GrayscaleNode.cs

@@ -1,6 +1,7 @@
 using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -34,7 +35,7 @@ public class GrayscaleNode : FilterNode
         CustomWeight = CreateInput("CustomWeight", "WEIGHT_FACTOR", new Vec3D(1, 1, 1));
     }
 
-    protected override ColorFilter? GetColorFilter()
+    protected override ColorFilter? GetColorFilter(RenderContext context)
     {
         if (Mode.Value == lastMode 
             && Factor.Value == lastFactor 

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/InvertFilterNode.cs

@@ -1,6 +1,7 @@
 using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -20,7 +21,7 @@ public class InvertFilterNode : FilterNode
         filter = ColorFilter.CreateColorMatrix(invertedMatrix);
     }
 
-    protected override ColorFilter? GetColorFilter()
+    protected override ColorFilter? GetColorFilter(RenderContext context)
     {
         filter?.Dispose();
 

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/KernelFilterNode.cs

@@ -1,6 +1,7 @@
 using Drawie.Backend.Core.Surfaces;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -37,7 +38,7 @@ public class KernelFilterNode : FilterNode
         OnAlpha = CreateInput(nameof(OnAlpha), "ON_ALPHA", false);
     }
 
-    protected override ImageFilter? GetImageFilter()
+    protected override ImageFilter? GetImageFilter(RenderContext context)
     {
         var kernel = Kernel.Value;
         

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/SepiaFilterNode.cs

@@ -2,6 +2,7 @@
 using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -32,7 +33,7 @@ public class SepiaFilterNode : FilterNode
         );
     }
 
-    protected override ColorFilter? GetColorFilter()
+    protected override ColorFilter? GetColorFilter(RenderContext context)
     {
         lastFilter?.Dispose();
 

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/ShadowNode.cs

@@ -1,6 +1,7 @@
 using Drawie.Backend.Core.ColorsImpl;
 using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
+using PixiEditor.ChangeableDocument.Rendering;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.FilterNodes;
 
@@ -18,7 +19,7 @@ public class ShadowNode : FilterNode
         Color = CreateInput("Color", "COLOR", Colors.Black);
     }
 
-    protected override ImageFilter? GetImageFilter()
+    protected override ImageFilter? GetImageFilter(RenderContext context)
     {
         return ImageFilter.CreateDropShadow((float)Offset.Value.X, (float)Offset.Value.Y, (float)Sigma.Value.X, (float)Sigma.Value.Y, Color.Value, null);
     }

+ 1 - 1
src/PixiEditor.Extensions/PixiEditor.Extensions.csproj

@@ -15,7 +15,7 @@
     <ItemGroup>
       <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
       <PackageReference Include="Avalonia.Remote.Protocol" Version="$(AvaloniaVersion)" />
-      <PackageReference Include="Svg.Controls.Skia.Avalonia" Version="11.3.0.1" />
+      <PackageReference Include="Svg.Controls.Skia.Avalonia" Version="11.3.0.3" />
       <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
       <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
       <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

+ 2 - 2
src/PixiEditor/PixiEditor.csproj

@@ -91,7 +91,7 @@
     <PackageReference Include="AsyncImageLoader.Avalonia" Version="3.3.0"/>
     <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
     <PackageReference Include="Avalonia.Headless" Version="$(AvaloniaVersion)"/>
-    <PackageReference Include="Avalonia.Labs.Lottie" Version="11.3.0" />
+    <PackageReference Include="Avalonia.Labs.Lottie" Version="11.3.1" />
     <PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)"/>
     <PackageReference Include="Avalonia.Skia" Version="$(AvaloniaVersion)"/>
     <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
@@ -105,7 +105,7 @@
     <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
     <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
     <PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
-    <PackageReference Include="Svg.Controls.Skia.Avalonia" Version="11.3.0.1" />
+    <PackageReference Include="Svg.Controls.Skia.Avalonia" Version="11.3.0.3" />
   </ItemGroup>
 
   <ItemGroup>

+ 4 - 1
src/PixiEditor/ViewModels/Document/DocumentViewModel.Serialization.cs

@@ -314,7 +314,10 @@ internal partial class DocumentViewModel
         var path = new SvgPath();
         if (data.Path != null)
         {
-            string pathData = data.Path.ToSvgPathData();
+            // This is super strange, we got reports that on linux with different locales, numbers are separated by commas
+            // and not dots. Comma separated svg data is invalid. This is raw Skia call, there is no other place where it could be changed.
+            // That's why we replace commas with dots here. I really hope skia never uses commas as a number separator
+            string pathData = data.Path.ToSvgPathData().Replace(",", ".");
             path.PathData.Unit = new SvgStringUnit(pathData);
             SvgFillRule fillRule = data.Path.FillType switch
             {

+ 1 - 1
tests/Directory.Build.props

@@ -1,7 +1,7 @@
 <Project>
     <PropertyGroup>
         <CodeAnalysisRuleSet>../Custom.ruleset</CodeAnalysisRuleSet>
-		<AvaloniaVersion>11.3.0</AvaloniaVersion>
+		<AvaloniaVersion>11.3.3</AvaloniaVersion>
     </PropertyGroup>
     <ItemGroup>
         <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />