Minor improvement to `LuaPictureBox.DrawPolygon`

This commit is contained in:
YoshiRulz 2025-01-04 00:19:06 +10:00
parent ed59b5e874
commit 6ffc71b183
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 2 deletions

View File

@ -276,11 +276,12 @@ namespace BizHawk.Client.EmuHawk
var pointsList = TableHelper.EnumerateValues<LuaTable>(points)
.Select(table => TableHelper.EnumerateValues<long>(table).ToList()).ToList();
var pointsArr = new Point[pointsList.Count];
var x1 = x ?? 0;
var y1 = y ?? 0;
var i = 0;
foreach (var point in pointsList)
{
pointsArr[i] = new Point((int) point[0] + x ?? 0, (int) point[1] + y ?? 0);
i++;
pointsArr[i++] = new(x1 + (int) point[0], y1 + (int) point[1]);
}
var boxBackground = Graphics.FromImage(Image);