Skip to content

Commit

Permalink
Fix off by ones for drawPolygon
Browse files Browse the repository at this point in the history
  • Loading branch information
CasualPokePlayer committed Jun 1, 2024
1 parent f13f69b commit c1d5d17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit c1d5d17

Please sign in to comment.