Skip to content

Commit b89a0af

Browse files
Use IEnumerable for DrawGlyphs
1 parent d444734 commit b89a0af

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/ImageSharp.Drawing/Processing/DrawingCanvas{TPixel}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ public void DrawText(
513513
public void DrawGlyphs(
514514
Brush brush,
515515
Pen pen,
516-
IReadOnlyList<GlyphPathCollection> glyphs)
516+
IEnumerable<GlyphPathCollection> glyphs)
517517
{
518518
this.EnsureNotDisposed();
519519
Guard.NotNull(brush, nameof(brush));
@@ -524,9 +524,8 @@ public void DrawGlyphs(
524524
DrawingOptions baseOptions = state.Options;
525525
IReadOnlyList<IPath> clipPaths = state.ClipPaths;
526526

527-
for (int glyphIndex = 0; glyphIndex < glyphs.Count; glyphIndex++)
527+
foreach (GlyphPathCollection glyph in glyphs)
528528
{
529-
GlyphPathCollection glyph = glyphs[glyphIndex];
530529
if (glyph.LayerCount == 0)
531530
{
532531
continue;

src/ImageSharp.Drawing/Processing/IDrawingCanvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void DrawText(
211211
public void DrawGlyphs(
212212
Brush brush,
213213
Pen pen,
214-
IReadOnlyList<GlyphPathCollection> glyphs);
214+
IEnumerable<GlyphPathCollection> glyphs);
215215

216216
/// <summary>
217217
/// Measures the logical advance of the text in pixel units.

0 commit comments

Comments
 (0)