Browse Source

Merge branch 'master' into func-matrix

Krzysztof Krysiński 1 month ago
parent
commit
fa95c6c055

+ 8 - 0
src/Directory.Build.props

@@ -56,6 +56,14 @@
     <Optimize>true</Optimize>
   </PropertyGroup>
 
+
+  <PropertyGroup Condition="'$(Configuration)'=='ReleaseNoUpdate'">
+    <DefineConstants>TRACE;RELEASE</DefineConstants>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
+    <Optimize>true</Optimize>
+  </PropertyGroup>
+
   <PropertyGroup Condition="'$(Configuration)'=='Debug'">
     <DebugType>full</DebugType>
     <DebugSymbols>true</DebugSymbols>

+ 2 - 2
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(AppDomain.CurrentDomain.BaseDirectory), path);
+        string binaryPath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), path);
 
         GlobalFFOptions.Configure(new FFOptions() { BinaryFolder = binaryPath });
 
@@ -89,7 +89,7 @@ public class FFMpegRenderer : IAnimationRenderer
     {
         string path = $"ThirdParty/{IOperatingSystem.Current.Name}/ffmpeg";
 
-        string binaryPath = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), path);
+        string binaryPath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), path);
 
         GlobalFFOptions.Configure(new FFOptions() { BinaryFolder = binaryPath });
 

+ 5 - 0
src/PixiEditor.ChangeableDocument/Changes/Animation/DeleteKeyFrame_Change.cs

@@ -35,6 +35,11 @@ internal class DeleteKeyFrame_Change : Change
             
             KeyFrameData data = node.KeyFrames.FirstOrDefault(x => x.KeyFrameGuid == keyFrame.Id);
 
+            if (data is null)
+            {
+                return false;
+            }
+
             savedKeyFrameData = data.Clone();
             
             return true;

+ 23 - 4
src/PixiEditor/Helpers/DocumentViewModelBuilder.cs

@@ -164,19 +164,38 @@ internal class DocumentViewModelBuilder
 
         foreach (var node in documentGraph.AllNodes)
         {
-            if (node.KeyFrames.Length > 1 && data.All(x => x.NodeId != node.Id))
+            if (node.KeyFrames.Length > 1)
             {
-                GroupKeyFrameBuilder builder = new GroupKeyFrameBuilder()
-                    .WithNodeId(node.Id);
+                var existingGroup = groups.FirstOrDefault(x => x.NodeId == node.Id);
+                GroupKeyFrameBuilder builder = null;
+                if (existingGroup != null)
+                {
+                    builder = data
+                        .OfType<GroupKeyFrameBuilder>()
+                        .FirstOrDefault(x => x.NodeId == existingGroup.NodeId);
+                }
+
+                if (builder == null)
+                {
+                    builder = new GroupKeyFrameBuilder()
+                        .WithNodeId(node.Id);
+                }
+
 
                 foreach (var keyFrame in node.KeyFrames)
                 {
+                    if (builder.Children.Any(x => x.KeyFrameId == keyFrame.Id))
+                    {
+                        continue; // Skip if the keyframe already exists in the group
+                    }
+
                     builder.WithChild<KeyFrameBuilder>(x => x
                         .WithKeyFrameId(keyFrame.Id)
                         .WithNodeId(node.Id));
                 }
 
-                data.Add(builder);
+                if(existingGroup == null)
+                    data.Add(builder);
             }
         }
     }

+ 4 - 0
src/PixiEditor/PixiEditor.csproj

@@ -60,6 +60,10 @@
     <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(Configuration)' == 'ReleaseNoUpdate' ">
+    <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
+  </ItemGroup>
+
   <ItemGroup Condition=" '$(Configuration)' == 'DevRelease' ">
     <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
   </ItemGroup>

+ 4 - 3
src/PixiEditor/ViewModels/SubViewModels/MiscViewModel.cs

@@ -15,13 +15,13 @@ internal class MiscViewModel : SubViewModel<ViewModelMain>
     }
 
     [Command.Internal("PixiEditor.Links.OpenHyperlink")]
-    [Command.Basic("PixiEditor.Links.OpenDocumentation", "https://pixieditor.net/docs/introduction", "DOCUMENTATION", "OPEN_DOCUMENTATION", Icon = PixiPerfectIcons.Globe,
+    [Command.Basic("PixiEditor.Links.OpenDocumentation", "https://pixieditor.net/docs/", "DOCUMENTATION", "OPEN_DOCUMENTATION", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/DOCUMENTATION", MenuItemOrder = 0, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenWebsite", "https://pixieditor.net", "WEBSITE", "OPEN_WEBSITE", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/WEBSITE", MenuItemOrder = 1, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenRepository", "https://github.com/PixiEditor/PixiEditor", "REPOSITORY", "OPEN_REPOSITORY", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/REPOSITORY", MenuItemOrder = 2, AnalyticsTrack = true)]
-    [Command.Basic("PixiEditor.Links.OpenLicense", "{BaseDir}LICENSE", "LICENSE", "OPEN_LICENSE", Icon = PixiPerfectIcons.Folder,
+    [Command.Basic("PixiEditor.Links.OpenLicense", "{BaseDir}/LICENSE", "LICENSE", "OPEN_LICENSE", Icon = PixiPerfectIcons.Folder,
         MenuItemPath = "HELP/LICENSE", MenuItemOrder = 3, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenOtherLicenses", "{BaseDir}/Third Party Licenses", "THIRD_PARTY_LICENSES", "OPEN_THIRD_PARTY_LICENSES", Icon = PixiPerfectIcons.Folder,
         MenuItemPath = "HELP/THIRD_PARTY_LICENSES", MenuItemOrder = 4, AnalyticsTrack = true)]
@@ -31,7 +31,8 @@ internal class MiscViewModel : SubViewModel<ViewModelMain>
         {
             if (uri.StartsWith("{BaseDir}"))
             {
-                uri = uri.Replace("{BaseDir}", AppDomain.CurrentDomain.BaseDirectory);
+                string exeDir = Path.GetDirectoryName(Environment.ProcessPath);
+                uri = uri.Replace("{BaseDir}", exeDir ?? string.Empty);
             }
             
             IOperatingSystem.Current.OpenUri(uri);

+ 4 - 3
src/PixiEditor/ViewModels/SubViewModels/UpdateViewModel.cs

@@ -140,7 +140,8 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
     {
         if (IOperatingSystem.Current.IsLinux)
         {
-            if (File.Exists("no-updates"))
+            string exeDir = Path.GetDirectoryName(Environment.ProcessPath);
+            if (File.Exists(Path.Combine(exeDir, "no-updates")))
             {
                 UpdateState = UpdateState.UnableToCheck;
                 return;
@@ -283,7 +284,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
         UpdateChecker.SetLatestReleaseInfo(new ReleaseInfo(true) { TagName = "2.2.2.2" });
         Install(true);
     }
-    
+
     [Command.Debug("PixiEditor.Update.DebugDownload", "Debug Download Update",
         "(DEBUG) Download update file")]
     public void DebugDownload()
@@ -379,7 +380,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
 
     private static bool InstallDirReadOnly()
     {
-        string installDir = AppDomain.CurrentDomain.BaseDirectory;
+        string installDir = Path.GetDirectoryName(Environment.ProcessPath);
         DirectoryInfo dirInfo = new DirectoryInfo(installDir);
         return dirInfo.Attributes.HasFlag(FileAttributes.ReadOnly);
     }

+ 4 - 4
src/PixiEditor/Views/Main/ViewportControls/Viewport.axaml

@@ -97,16 +97,16 @@
                         </StackPanel>
                         <Separator />
                         <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="10">
-                            <ToggleButton Width="32" Height="32" ui:Translator.TooltipKey="TOGGLE_VERTICAL_SYMMETRY"
+                            <ToggleButton Width="32" Height="32" ui:Translator.TooltipKey="TOGGLE_HORIZONTAL_SYMMETRY"
                                           Classes="OverlayToggleButton pixi-icon"
                                           IsChecked="{Binding Document.VerticalSymmetryAxisEnabledBindable, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=TwoWay}"
-                                          Content="{DynamicResource icon-y-symmetry}"
+                                          Content="{DynamicResource icon-x-symmetry}"
                                           Cursor="Hand" />
                             <ToggleButton Width="32" Height="32"
-                                          ui:Translator.TooltipKey="TOGGLE_HORIZONTAL_SYMMETRY"
+                                          ui:Translator.TooltipKey="TOGGLE_VERTICAL_SYMMETRY"
                                           Classes="OverlayToggleButton pixi-icon"
                                           IsChecked="{Binding Document.HorizontalSymmetryAxisEnabledBindable, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=TwoWay}"
-                                          Content="{DynamicResource icon-x-symmetry}"
+                                          Content="{DynamicResource icon-y-symmetry}"
                                           Cursor="Hand" />
                         </StackPanel>
                         <Separator />