Browse Source

Fix nullable warnings

CPKreuz 1 năm trước cách đây
mục cha
commit
fa54b0d024

+ 3 - 3
src/ChunkyImageLib/Operations/EllipseOperation.cs

@@ -21,7 +21,7 @@ internal class EllipseOperation : IMirroredDrawOperation
     private VectorPath? outerPath;
     private VectorPath? innerPath;
     
-    private VectorPath ellipseOutline;
+    private VectorPath? ellipseOutline;
     private Point[]? ellipse;
     private Point[]? ellipseFill;
     private RectI? ellipseFillRect;
@@ -102,14 +102,14 @@ internal class EllipseOperation : IMirroredDrawOperation
                 {
                     paint.Color = fillColor;
                     paint.Style = PaintStyle.Fill;
-                    surf.Canvas.DrawPath(ellipseOutline, paint);
+                    surf.Canvas.DrawPath(ellipseOutline!, paint);
                 }
                 
                 paint.Color = strokeColor;
                 paint.Style = PaintStyle.Stroke;
                 paint.StrokeWidth = 1f;
                 
-                surf.Canvas.DrawPath(ellipseOutline, paint);
+                surf.Canvas.DrawPath(ellipseOutline!, paint);
 
                 surf.Canvas.Restore();
             }

+ 1 - 1
src/PixiEditor.Zoombox/Zoombox.cs

@@ -125,7 +125,7 @@ public partial class Zoombox : ContentControl, INotifyPropertyChanged
         remove => RemoveHandler(ViewportMovedEvent, value);
     }
 
-    public event Action<double> ScaleChanged;
+    public event Action<double>? ScaleChanged;
 
     public VecD CanvasPos => ToScreenSpace(VecD.Zero);
     public double CanvasX => ToScreenSpace(VecD.Zero).X;