Prechádzať zdrojové kódy

Fixed fill type not updating canvas

Krzysztof Krysiński 5 mesiacov pred
rodič
commit
76cf8530b0

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 7b79ed74f73de883c3dbea383f0a410d52ebdba6
+Subproject commit 676738f1cb90e799f574851ad93171e18e434434

+ 18 - 2
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/Shapes/Data/PathVectorData.cs

@@ -21,6 +21,20 @@ public class PathVectorData : ShapeVectorData, IReadOnlyPathData
 
     public StrokeJoin StrokeLineJoin { get; set; } = StrokeJoin.Round;
 
+    public PathFillType FillType
+    {
+        get => Path?.FillType ?? PathFillType.Winding;
+        set
+        {
+            if (Path == null)
+            {
+                return;
+            }
+
+            Path.FillType = value;
+        }
+    }
+
     public PathVectorData(VectorPath path)
     {
         Path = path;
@@ -93,6 +107,7 @@ public class PathVectorData : ShapeVectorData, IReadOnlyPathData
         hash.Add(Path);
         hash.Add(StrokeLineCap);
         hash.Add(StrokeLineJoin);
+        hash.Add(FillType);
 
         return hash.ToHashCode();
     }
@@ -118,7 +133,8 @@ public class PathVectorData : ShapeVectorData, IReadOnlyPathData
 
     protected bool Equals(PathVectorData other)
     {
-        return base.Equals(other) && Path.Equals(other.Path) && StrokeLineCap == other.StrokeLineCap && StrokeLineJoin == other.StrokeLineJoin;
+        return base.Equals(other) && Path.Equals(other.Path) && StrokeLineCap == other.StrokeLineCap && StrokeLineJoin == other.StrokeLineJoin
+                && FillType == other.FillType;
     }
 
     public override bool Equals(object? obj)
@@ -143,6 +159,6 @@ public class PathVectorData : ShapeVectorData, IReadOnlyPathData
 
     public override int GetHashCode()
     {
-        return HashCode.Combine(base.GetHashCode(), Path, (int)StrokeLineCap, (int)StrokeLineJoin);
+        return HashCode.Combine(base.GetHashCode(), Path, (int)StrokeLineCap, (int)StrokeLineJoin, FillType);
     }
 }