Skip to content

Commit 25664df

Browse files
committed
Updated ImageSharp drawing package and code
1 parent 6f721d9 commit 25664df

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

MazeGrid/Grid.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public Image ToPng(int cellSize = 10)
143143
int imgWidth = cellSize * Columns;
144144
int imgHeight = cellSize * Rows;
145145

146-
IPen wall = Pens.Solid(Color.Black, 1);
146+
Pen wall = Pens.Solid(Color.Black, 1);
147147

148148
Image<Rgba32> mazeImage = new(imgWidth, imgHeight);
149149

@@ -173,13 +173,13 @@ public Image ToPng(int cellSize = 10)
173173

174174

175175
if (cell.North == null)
176-
mazeImage.Mutate(x => x.DrawLines(wall, new Point(x1, y1), new Point(x2, y1)));
176+
mazeImage.Mutate(x => x.DrawPolygon(wall, new Point(x1, y1), new Point(x2, y1)));
177177
if (cell.West == null)
178-
mazeImage.Mutate(x => x.DrawLines(wall, new Point(x1, y1), new Point(x1, y2)));
178+
mazeImage.Mutate(x => x.DrawPolygon(wall, new Point(x1, y1), new Point(x1, y2)));
179179
if (!cell.IsLinked(cell.East))
180-
mazeImage.Mutate(x => x.DrawLines(wall, new Point(x2, y1), new Point(x2, y2)));
180+
mazeImage.Mutate(x => x.DrawPolygon(wall, new Point(x2, y1), new Point(x2, y2)));
181181
if (!cell.IsLinked(cell.South))
182-
mazeImage.Mutate(x => x.DrawLines(wall, new Point(x1, y2), new Point(x2, y2)));
182+
mazeImage.Mutate(x => x.DrawPolygon(wall, new Point(x1, y2), new Point(x2, y2)));
183183
}
184184

185185
return mazeImage;

MazeGrid/MazeGrid.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
11-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta14" />
11+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
1212
</ItemGroup>
1313

1414
</Project>

0 commit comments

Comments
 (0)