Skip to content

Commit

Permalink
Removed BitmapPixelChanges.FromSelection since it's redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Dec 3, 2020
1 parent 0b8d512 commit 71996bc
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions PixiEditor/Models/DataHolders/BitmapPixelChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,6 @@ public static BitmapPixelChanges FromSingleColoredArray(IEnumerable<Coordinates>
return new BitmapPixelChanges(dict) { WasBuiltAsSingleColored = true };
}

/// <summary>
/// Builds BitmapPixelChanges from coordinates in layer.
/// </summary>
/// <param name="selectedPoints">Pixels coordinates in layer.</param>
/// <param name="activeLayer">Layer from pixels are taken.</param>
/// <returns>BitmapPixelChanges.</returns>
public static BitmapPixelChanges FromSelection(IEnumerable<Coordinates> selectedPoints, Layer activeLayer)
{
Dictionary<Coordinates, Color> dict = new Dictionary<Coordinates, Color>();
using (var ctx = activeLayer.LayerBitmap.GetBitmapContext())
{
foreach (var point in selectedPoints)
{
dict.Add(point, ctx.WriteableBitmap.GetPixel(point.X, point.Y));
}
}

return new BitmapPixelChanges(dict);
}

/// <summary>
/// Combines pixel changes array with overriding values.
/// </summary>
Expand Down

0 comments on commit 71996bc

Please sign in to comment.