From c1d5d17771b9347a641344a662fe3e78526c5f71 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:24:43 -0700 Subject: [PATCH] Fix off by ones for drawPolygon --- src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs index 5a25ad7b8fa..cbbff14faf0 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs @@ -512,7 +512,7 @@ public void FillPie(Color color, int x, int y, int width, int height, int startA 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 @@ public unsafe void DrawPolygon(Color color, Point[] points) 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(