Browse Source

Icons and improved performance by reducing tight bounds precision for previews

Krzysztof Krysiński 5 months ago
parent
commit
d50e650e94

+ 2 - 2
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/ImageLayerNode.cs

@@ -125,13 +125,13 @@ public class ImageLayerNode : LayerNode, IReadOnlyImageNode
 
 
             if (keyFrame != null)
             if (keyFrame != null)
             {
             {
-                return (RectD?)GetLayerImageByKeyFrameGuid(keyFrame.KeyFrameGuid).FindTightCommittedBounds();
+                return (RectD?)GetLayerImageByKeyFrameGuid(keyFrame.KeyFrameGuid).FindChunkAlignedCommittedBounds();
             }
             }
         }
         }
 
 
         try
         try
         {
         {
-            return (RectD?)GetLayerImageAtFrame(frame).FindTightCommittedBounds();
+            return (RectD?)GetLayerImageAtFrame(frame).FindChunkAlignedCommittedBounds();
         }
         }
         catch (ObjectDisposedException)
         catch (ObjectDisposedException)
         {
         {

+ 5 - 5
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Matrix/TranslateNode.cs → src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Matrix/OffsetNode.cs

@@ -3,14 +3,14 @@ using Drawie.Numerics;
 
 
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 
 
-[NodeInfo("Translate")]
-public class TranslateNode : Matrix3X3BaseNode
+[NodeInfo("Offset")]
+public class OffsetNode : Matrix3X3BaseNode
 {
 {
     public InputProperty<VecD> Translation { get; }
     public InputProperty<VecD> Translation { get; }
 
 
-    public TranslateNode()
+    public OffsetNode()
     {
     {
-        Translation = CreateInput("Translation", "TRANSLATION", VecD.Zero);
+        Translation = CreateInput("Offset", "OFFSET", VecD.Zero);
     }
     }
 
 
     protected override Matrix3X3 CalculateMatrix(Matrix3X3 input)
     protected override Matrix3X3 CalculateMatrix(Matrix3X3 input)
@@ -21,6 +21,6 @@ public class TranslateNode : Matrix3X3BaseNode
 
 
     public override Node CreateCopy()
     public override Node CreateCopy()
     {
     {
-        return new TranslateNode();
+        return new OffsetNode();
     }
     }
 }
 }

+ 1 - 2
src/PixiEditor/Data/Localization/Languages/en.json

@@ -880,8 +880,7 @@
   "TILE_MODE_Y": "Tile Mode Y",
   "TILE_MODE_Y": "Tile Mode Y",
   "TILE_NODE": "Tile",
   "TILE_NODE": "Tile",
   "SKEW": "Skew",
   "SKEW": "Skew",
-  "TRANSLATION": "Translation",
-  "TRANSLATE_NODE": "Translate",
+  "OFFSET_NODE": "Offset",
   "SKEW_NODE": "Skew",
   "SKEW_NODE": "Skew",
   "ROTATION_NODE": "Rotation",
   "ROTATION_NODE": "Rotation",
   "SCALE_NODE": "Scale",
   "SCALE_NODE": "Scale",

+ 0 - 1
src/PixiEditor/Styles/Templates/NodeGraphView.axaml

@@ -7,7 +7,6 @@
         <Setter Property="Template">
         <Setter Property="Template">
             <ControlTemplate>
             <ControlTemplate>
                 <Grid Background="Transparent">
                 <Grid Background="Transparent">
-
                     <Rectangle Name="PART_SelectionRectangle" HorizontalAlignment="Left"
                     <Rectangle Name="PART_SelectionRectangle" HorizontalAlignment="Left"
                                VerticalAlignment="Top"
                                VerticalAlignment="Top"
                                IsVisible="False" ZIndex="100"
                                IsVisible="False" ZIndex="100"

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/DocumentInfoNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes;
 namespace PixiEditor.ViewModels.Document.Nodes;
 
 
-[NodeViewModel("DOCUMENT_INFO_NODE", "", "")]
+[NodeViewModel("DOCUMENT_INFO_NODE", "", PixiPerfectIcons.Info)]
 internal class DocumentInfoNodeViewModel : NodeViewModel<DocumentInfoNode>;
 internal class DocumentInfoNodeViewModel : NodeViewModel<DocumentInfoNode>;

+ 8 - 0
src/PixiEditor/ViewModels/Document/Nodes/Matrix/OffsetNodeViewModel.cs

@@ -0,0 +1,8 @@
+using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
+using PixiEditor.UI.Common.Fonts;
+using PixiEditor.ViewModels.Nodes;
+
+namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
+
+[NodeViewModel("OFFSET_NODE", "MATRIX", PixiPerfectIcons.MoveView)]
+internal class OffsetNodeViewModel : NodeViewModel<OffsetNode>;

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/Matrix/RotateNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 
 
-[NodeViewModel("ROTATE_NODE", "MATRIX", "")]
+[NodeViewModel("ROTATE_NODE", "MATRIX", PixiPerfectIcons.RotateView)]
 internal class RotateNodeViewModel : NodeViewModel<RotateNode>;
 internal class RotateNodeViewModel : NodeViewModel<RotateNode>;

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/Matrix/ScaleNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 
 
-[NodeViewModel("SCALE_NODE", "MATRIX", "")]
+[NodeViewModel("SCALE_NODE", "MATRIX", PixiPerfectIcons.Minimize)]
 internal class ScaleNodeViewModel : NodeViewModel<ScaleNode>;
 internal class ScaleNodeViewModel : NodeViewModel<ScaleNode>;

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/Matrix/SkewNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 
 
-[NodeViewModel("SKEW_NODE", "MATRIX", "")]
+[NodeViewModel("SKEW_NODE", "MATRIX", PixiPerfectIcons.Italic)]
 internal class SkewNodeViewModel : NodeViewModel<SkewNode>;
 internal class SkewNodeViewModel : NodeViewModel<SkewNode>;

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/Matrix/TransformNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
 
 
-[NodeViewModel("TRANSFORM_NODE", "MATRIX", "")]
+[NodeViewModel("TRANSFORM_NODE", "MATRIX", PixiPerfectIcons.CanvasResize)]
 internal class TransformNodeViewModel : NodeViewModel<TransformNode>;
 internal class TransformNodeViewModel : NodeViewModel<TransformNode>;

+ 0 - 7
src/PixiEditor/ViewModels/Document/Nodes/Matrix/TranslateNodeViewModel.cs

@@ -1,7 +0,0 @@
-using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Matrix;
-using PixiEditor.ViewModels.Nodes;
-
-namespace PixiEditor.ViewModels.Document.Nodes.Matrix;
-
-[NodeViewModel("TRANSLATE_NODE", "MATRIX", "")]
-internal class TranslateNodeViewModel : NodeViewModel<TranslateNode>;

+ 2 - 1
src/PixiEditor/ViewModels/Document/Nodes/TileNodeViewModel.cs

@@ -1,7 +1,8 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
+using PixiEditor.UI.Common.Fonts;
 using PixiEditor.ViewModels.Nodes;
 using PixiEditor.ViewModels.Nodes;
 
 
 namespace PixiEditor.ViewModels.Document.Nodes;
 namespace PixiEditor.ViewModels.Document.Nodes;
 
 
-[NodeViewModel("TILE_NODE", "IMAGE", "")]
+[NodeViewModel("TILE_NODE", "IMAGE", PixiPerfectIcons.Grid)]
 internal class TileNodeViewModel : NodeViewModel<TileNode>;
 internal class TileNodeViewModel : NodeViewModel<TileNode>;