Pārlūkot izejas kodu

Merge pull request #790 from PixiEditor/fixes/789

Fixed animation duplicate serialization and delete keyframe btn
Krzysztof Krysiński 4 mēneši atpakaļ
vecāks
revīzija
3077e88ae9

+ 1 - 1
src/PixiEditor/Helpers/DocumentViewModelBuilder.cs

@@ -317,7 +317,7 @@ internal class GroupKeyFrameBuilder : KeyFrameBuilder
     }
 
     public new GroupKeyFrameBuilder WithNodeId(int layerGuid) =>
-        base.WithKeyFrameId(layerGuid) as GroupKeyFrameBuilder;
+        base.WithNodeId(layerGuid) as GroupKeyFrameBuilder;
 }
 
 internal class NodeGraphBuilder

+ 5 - 1
src/PixiEditor/Views/Animations/Timeline.cs

@@ -223,6 +223,7 @@ internal class Timeline : TemplatedControl, INotifyPropertyChanged
 
 
         keyFrame?.Document.AnimationHandler.AddSelectedKeyFrame(keyFrame.Id);
+        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedKeyFrames)));
     }
 
     public bool DragAllSelectedKeyFrames(int delta)
@@ -304,13 +305,14 @@ internal class Timeline : TemplatedControl, INotifyPropertyChanged
 
                     int groupStartIndex = -1;
                     int groupEndIndex = -1;
-                    
+
                     for (int i = 0; i < KeyFrames.Count; i++)
                     {
                         if (KeyFrames[i].LayerGuid == lastSelected.LayerGuid)
                         {
                             groupStartIndex = i;
                         }
+
                         if (KeyFrames[i].LayerGuid == e.LayerGuid)
                         {
                             groupEndIndex = i;
@@ -398,6 +400,8 @@ internal class Timeline : TemplatedControl, INotifyPropertyChanged
         {
             keyFrame.Document.AnimationDataViewModel.RemoveSelectedKeyFrame(keyFrame.Id);
         }
+
+        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedKeyFrames)));
     }
 
     private void TimelineKeyFramesScrollOnScrollChanged(object? sender, ScrollChangedEventArgs e)