Browse Source

Make selection use evenodd fill

Fix typo
Equbuxu 3 years ago
parent
commit
4ce7bc320a

+ 1 - 1
src/PixiEditor.ChangeableDocument/Changes/Selection/SelectLasso_UpdateableChange.cs

@@ -5,7 +5,7 @@ namespace PixiEditor.ChangeableDocument.Changes.Selection;
 internal class SelectLasso_UpdateableChange : UpdateableChange
 internal class SelectLasso_UpdateableChange : UpdateableChange
 {
 {
     private SKPath? originalPath;
     private SKPath? originalPath;
-    private SKPath path = new();
+    private SKPath path = new() { FillType = SKPathFillType.EvenOdd };
     private readonly SelectionMode mode;
     private readonly SelectionMode mode;
 
 
     [GenerateUpdateableChangeActions]
     [GenerateUpdateableChangeActions]

+ 1 - 1
src/PixiEditor.ChangeableDocument/Changes/Selection/SelectRectangle_UpdateableChange.cs

@@ -31,7 +31,7 @@ internal class SelectRectangle_UpdateableChange : UpdateableChange
 
 
     private Selection_ChangeInfo CommonApply(Document target)
     private Selection_ChangeInfo CommonApply(Document target)
     {
     {
-        using var rect = new SKPath();
+        using var rect = new SKPath() { FillType = SKPathFillType.EvenOdd };
         rect.MoveTo(pos);
         rect.MoveTo(pos);
         rect.LineTo(pos.X + size.X, pos.Y);
         rect.LineTo(pos.X + size.X, pos.Y);
         rect.LineTo(pos + size);
         rect.LineTo(pos + size);

+ 1 - 1
src/PixiEditorPrototype/CustomControls/SelectionOverlay.cs

@@ -73,7 +73,7 @@ internal class SelectionOverlay : Control
 
 
         renderPath = new PathGeometry()
         renderPath = new PathGeometry()
         {
         {
-            FillRule = FillRule.Nonzero,
+            FillRule = FillRule.EvenOdd,
             Figures = (PathFigureCollection?)converter.ConvertFromString(Path.ToSvgPathData()),
             Figures = (PathFigureCollection?)converter.ConvertFromString(Path.ToSvgPathData()),
         };
         };
         drawingContext.DrawGeometry(null, whitePen, renderPath);
         drawingContext.DrawGeometry(null, whitePen, renderPath);

+ 1 - 1
src/README.md

@@ -106,7 +106,7 @@ Decouples the state of a document from the UI.
         - [x] Shift layer image
         - [x] Shift layer image
         - [ ] Move/Rotate selection
         - [ ] Move/Rotate selection
         - [ ] Transform selected area
         - [ ] Transform selected area
-        - [ ] Fill selection (fill with tranparent = delete)
+        - [ ] Fill selection (fill with transparent = delete)
         - [x] Clip to selection
         - [x] Clip to selection
         - [x] Lock transparency
         - [x] Lock transparency
         - [x] Create/Delete mask
         - [x] Create/Delete mask