-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'quickfill' of github.com:PixiEditor/PixiEditor into qui…
…ckfill
- Loading branch information
Showing
11 changed files
with
239 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using PixiEditor.Models.Layers; | ||
using PixiEditor.Models.Position; | ||
using SkiaSharp; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace PixiEditor.Models.Tools.Brushes | ||
{ | ||
public abstract class Brush | ||
{ | ||
public abstract void Draw(Layer layer, Tool tool, Coordinates coordinates, SKPaint paint); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using PixiEditor.Models.Layers; | ||
using PixiEditor.Models.Position; | ||
using PixiEditor.Models.Tools.Tools; | ||
using PixiEditor.Models.Tools.ToolSettings.Settings; | ||
using SkiaSharp; | ||
using System; | ||
|
||
namespace PixiEditor.Models.Tools.Brushes | ||
{ | ||
public class CircleBrush : Brush | ||
{ | ||
public override void Draw(Layer layer, Tool tool, Coordinates coordinates, SKPaint paint) | ||
{ | ||
int toolSize = tool.Toolbar.GetSetting<SizeSetting>("ToolSize").Value; | ||
int halfSize = (int)Math.Ceiling(toolSize / 2f); | ||
int modifier = toolSize % 2 != 0 ? 1 : 0; | ||
Coordinates topLeft = new Coordinates(coordinates.X - halfSize + modifier, coordinates.Y - halfSize + modifier); | ||
Coordinates bottomRight = new Coordinates(coordinates.X + halfSize - 1, coordinates.Y + halfSize - 1); | ||
|
||
CircleTool.DrawEllipseFromRect(layer, topLeft, bottomRight, paint.Color, paint.Color, 1, true); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
PixiEditor/Models/Tools/Brushes/CircleBrushOverrides/InterestingShapeBrush.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace PixiEditor.Models.Tools.Brushes | ||
{ | ||
public class InterestingShapeBrush : MatrixBrush | ||
{ | ||
public static readonly int[,] InterestingShapeMatrix = new int[,] | ||
{ | ||
{ 1, 1, 1 }, | ||
{ 0, 1, 0 }, | ||
{ 0, 1, 0 } | ||
}; | ||
|
||
public override int[,] BrushMatrix => InterestingShapeMatrix; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.