From 1d5a9e521dd0627a206d5f610069e9009cd7fc06 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:08:37 -0700 Subject: [PATCH] Fix some more off by ones with imgui 2D renderer thanks GDI+ --- src/BizHawk.Client.Common/Api/Classes/GuiApi.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs b/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs index e4606f8e6e..804b0f9120 100644 --- a/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/GuiApi.cs @@ -200,6 +200,8 @@ namespace BizHawk.Client.Common { var r = Get2DRenderer(surfaceID); var bg = background ?? _defaultBackground; + // GDI+ had an off by one here, we increment width and height to preserve backwards compatibility + width++; height++; if (bg != null) r.FillEllipse(bg.Value, x, y, width, height); r.CompositingMode = _compositingMode; r.DrawEllipse(line ?? _defaultForeground, x, y, width, height); @@ -333,6 +335,8 @@ namespace BizHawk.Client.Common var r = Get2DRenderer(surfaceID); r.CompositingMode = _compositingMode; var bg = background ?? _defaultBackground; + // GDI+ had an off by one here, we increment width and height to preserve backwards compatibility + width++; height++; if (bg != null) r.FillPie(bg.Value, x, y, width, height, startangle, sweepangle); r.DrawPie(line ?? _defaultForeground, x + 1, y + 1, width - 1, height - 1, startangle, sweepangle); }