Skip to content

Commit

Permalink
Attempt to optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Equbuxu committed Sep 29, 2021
1 parent 6d26fa1 commit c612fc7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PixiEditor/Models/Controllers/BitmapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,18 @@ private void HighlightPixels(Coordinates newPosition)
{
ActiveDocument.PreviewLayer = null;
}
else
else if (ActiveDocument.PreviewLayer == null)
{
ActiveDocument.GeneratePreviewLayer();
ActiveDocument.PreviewLayer.SetPixels(
BitmapPixelChanges.FromSingleColoredArray(highlightArea, new SKColor(0, 0, 0, 77)));
}
else
{
ActiveDocument.PreviewLayer.Clear();
ActiveDocument.PreviewLayer.SetPixels(
BitmapPixelChanges.FromSingleColoredArray(highlightArea, new SKColor(0, 0, 0, 77)));
}
}

private bool CanChangeHighlightOffset(IEnumerable<Coordinates> highlightArea)
Expand Down

0 comments on commit c612fc7

Please sign in to comment.