Skip to content

Commit

Permalink
Significantly fixed performance of select tool
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Apr 27, 2021
1 parent 547704a commit 977f3c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PixiEditor/Models/Tools/Tools/SelectTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace PixiEditor.Models.Tools.Tools
public class SelectTool : ReadonlyTool
{
private IEnumerable<Coordinates> oldSelectedPoints;
private RectangleTool rectangleTool = new RectangleTool();

private static Selection ActiveSelection { get => ViewModelMain.Current.BitmapManager.ActiveDocument.ActiveSelection; }

Expand Down Expand Up @@ -57,7 +58,6 @@ public override void Use(Coordinates[] pixels)

public IEnumerable<Coordinates> GetRectangleSelectionForPoints(Coordinates start, Coordinates end)
{
RectangleTool rectangleTool = new RectangleTool();
List<Coordinates> selection = rectangleTool.CreateRectangle(start, end, 1).ToList();
selection.AddRange(rectangleTool.CalculateFillForRectangle(start, end, 1));
return selection;
Expand Down

0 comments on commit 977f3c5

Please sign in to comment.