Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Nov 23, 2021
1 parent 27e9159 commit 4f1ce92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion PixiEditor/Models/ImageManipulation/ToolCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ namespace PixiEditor.Models.ImageManipulation
{
public static class ToolCalculator
{
public static void GetLinearFill(Layer layer, Coordinates startingCoords, int maxWidth, int maxHeight, SKColor newColor, List<Coordinates> output)
/// <summary>
/// This function calculates fill and outputs it into Coordinates list.
/// </summary>
/// <remarks>All coordinates are calculated without layer offset.
/// If you want to take consideration offset, just do it in CalculateBresenhamLine in PerformLinearFill function.</remarks>
/// <param name="layer">Layer to calculate fill from.</param>
/// <param name="startingCoords">Starting fill coordinates</param>
/// <param name="maxWidth">Maximum fill width</param>
/// <param name="maxHeight">Maximum fill height</param>
/// <param name="newColor">Replacement color to stop on</param>
/// <param name="output">List with output coordinates.</param>
public static void GetLinearFillAbsolute(Layer layer, Coordinates startingCoords, int maxWidth, int maxHeight, SKColor newColor, List<Coordinates> output)
{
Queue<FloodFillRange> floodFillQueue = new Queue<FloodFillRange>();
SKColor colorToReplace = layer.GetPixelWithOffset(startingCoords.X, startingCoords.Y);
Expand Down
2 changes: 1 addition & 1 deletion PixiEditor/Models/Tools/Tools/MagicWandTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public override void OnRecordingLeftMouseDown(MouseEventArgs e)

newSelection.Clear();

ToolCalculator.GetLinearFill(
ToolCalculator.GetLinearFillAbsolute(
layer,
new Coordinates(
(int)document.MouseXOnCanvas,
Expand Down

0 comments on commit 4f1ce92

Please sign in to comment.