Fix off by ones for drawPolygon

This commit is contained in:
CasualPokePlayer 2024-06-01 15:24:43 -07:00
parent f13f69b1ed
commit c1d5d17771
1 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ namespace BizHawk.Bizware.Graphics
public unsafe void DrawPolygon(Color color, Point[] points)
{
var vectorPoints = Array.ConvertAll(points, static p => p.ToVector());
var vectorPoints = Array.ConvertAll(points, static p => new Vector2(p.X + 0.5f, p.Y + 0.5f));
fixed (Vector2* p = vectorPoints)
{
_imGuiDrawList.AddPolyline(
@ -526,7 +526,7 @@ namespace BizHawk.Bizware.Graphics
public unsafe void FillPolygon(Color color, Point[] points)
{
var vectorPoints = Array.ConvertAll(points, static p => p.ToVector());
var vectorPoints = Array.ConvertAll(points, static p => new Vector2(p.X + 0.5f, p.Y + 0.5f));
fixed (Vector2* p = vectorPoints)
{
_imGuiDrawList.AddConcavePolyFilled(