2
0
Эх сурвалжийг харах

Excluded transform from bounds updating

flabbet 7 сар өмнө
parent
commit
fc323aff83

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 660dca615ac67c1c2e5b3c312753b4039044fc86
+Subproject commit 43ef993d73cb6a46667823ca5c80d6acf2607750

+ 1 - 11
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Shapes/Data/ShapeVectorData.cs

@@ -12,17 +12,8 @@ namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Shapes.Data;
 public abstract class ShapeVectorData : ICacheable, ICloneable, IReadOnlyShapeVectorData
 {
     private float strokeWidth = 1;
-    private Matrix3X3 transformationMatrix = Matrix3X3.Identity;
 
-    public Matrix3X3 TransformationMatrix
-    {
-        get => transformationMatrix;
-        set
-        {
-            transformationMatrix = value;
-            OnMatrixChanged(); 
-        }
-    }
+    public Matrix3X3 TransformationMatrix { get; set; } = Matrix3X3.Identity;
 
     public Color StrokeColor { get; set; } = Colors.White;
     public Color FillColor { get; set; } = Colors.White;
@@ -68,7 +59,6 @@ public abstract class ShapeVectorData : ICacheable, ICloneable, IReadOnlyShapeVe
 
     protected virtual void AdjustCopy(ShapeVectorData copy) { }
     
-    protected virtual void OnMatrixChanged() { }
     protected virtual void OnStrokeWidthChanged() { }
 
     public override int GetHashCode()

+ 3 - 6
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Shapes/Data/TextVectorData.cs

@@ -21,7 +21,8 @@ public class TextVectorData : ShapeVectorData, IReadOnlyTextData
         set
         {
             text = value;
-            richText = new RichText(value);
+            richText = new RichText(value) { Spacing = Spacing, MaxWidth = MaxWidth, StrokeWidth = StrokeWidth };
+
             lastBounds = richText.MeasureBounds(Font);
         }
     }
@@ -53,13 +54,9 @@ public class TextVectorData : ShapeVectorData, IReadOnlyTextData
     
     public bool AntiAlias { get; set; } = true;
 
-    protected override void OnMatrixChanged()
-    {
-        lastBounds = richText.MeasureBounds(Font);
-    }
-
     protected override void OnStrokeWidthChanged()
     {
+        richText.StrokeWidth = StrokeWidth;
         lastBounds = richText.MeasureBounds(Font);
     }