Browse Source

Fixed rectangle radius not saving

Krzysztof Krysiński 3 months ago
parent
commit
ba424f0581

+ 8 - 1
src/PixiEditor/Models/Serialization/Factories/RectangleSerializationFactory.cs

@@ -15,6 +15,7 @@ internal class RectangleSerializationFactory : VectorShapeSerializationFactory<R
     {
     {
         builder.AddVecD(original.Center);
         builder.AddVecD(original.Center);
         builder.AddVecD(original.Size);
         builder.AddVecD(original.Size);
+        builder.AddDouble(original.CornerRadius);
     }
     }
 
 
     protected override bool DeserializeVectorData(ByteExtractor extractor, Matrix3X3 matrix, Paintable strokePaintable,
     protected override bool DeserializeVectorData(ByteExtractor extractor, Matrix3X3 matrix, Paintable strokePaintable,
@@ -24,6 +25,11 @@ internal class RectangleSerializationFactory : VectorShapeSerializationFactory<R
     {
     {
         VecD center = extractor.GetVecD();
         VecD center = extractor.GetVecD();
         VecD size = extractor.GetVecD();
         VecD size = extractor.GetVecD();
+        double cornerRadius = 0;
+        if (!IsFilePreVersion(serializerData, new Version(2, 0, 0, 81)))
+        {
+            cornerRadius = extractor.GetDouble();
+        }
 
 
         original = new RectangleVectorData(center, size)
         original = new RectangleVectorData(center, size)
         {
         {
@@ -31,7 +37,8 @@ internal class RectangleSerializationFactory : VectorShapeSerializationFactory<R
             FillPaintable = fillPaintable,
             FillPaintable = fillPaintable,
             StrokeWidth = strokeWidth,
             StrokeWidth = strokeWidth,
             TransformationMatrix = matrix,
             TransformationMatrix = matrix,
-            Fill = fill
+            Fill = fill,
+            CornerRadius = cornerRadius
         };
         };
 
 
         return true;
         return true;

+ 2 - 2
src/PixiEditor/Properties/AssemblyInfo.cs

@@ -41,5 +41,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0.80")]
-[assembly: AssemblyFileVersion("2.0.0.80")]
+[assembly: AssemblyVersion("2.0.0.81")]
+[assembly: AssemblyFileVersion("2.0.0.81")]