diff --git a/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/GdiPlusRenderer.cs b/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/GdiPlusRenderer.cs index 5b7411e28f..61683ef789 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/GdiPlusRenderer.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/GdiPlusRenderer.cs @@ -40,11 +40,9 @@ namespace BizHawk.Client.EmuHawk.CustomControls _graphics.DrawImage(bitmap, point); } - public void DrawRectangle(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) + public void DrawRectangle(Rectangle rect) { - _graphics.DrawRectangle( - _currentPen, - new Rectangle(nLeftRect, nTopRect, nRightRect - nLeftRect, nBottomRect - nTopRect)); + _graphics.DrawRectangle(_currentPen, rect); } public void DrawString(string str, Rectangle rect) diff --git a/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/IControlRenderer.cs b/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/IControlRenderer.cs index ef778b451a..c16ead6856 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/IControlRenderer.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/ControlRenderer/IControlRenderer.cs @@ -27,7 +27,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls /// void DrawString(string str, Rectangle rect); - void DrawRectangle(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); + void DrawRectangle(Rectangle rect); void FillRectangle(int x, int y, int w, int h); /// diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs index 141be83790..e88f2dafff 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs @@ -105,10 +105,9 @@ namespace BizHawk.Client.EmuHawk columnWidth = ColumnWidth; columnHeight = GetHColHeight(columnIndex); } + int x1 = _currentX.Value - (columnWidth / 2); int y1 = _currentY.Value - (columnHeight / 2); - int x2 = x1 + columnWidth; - int y2 = y1 + columnHeight; int textOffsetY = CellHeightPadding; if (HorizontalOrientation) { @@ -117,7 +116,7 @@ namespace BizHawk.Client.EmuHawk } _renderer.SetSolidPen(_backColor); - _renderer.DrawRectangle(x1, y1, x2, y2); + _renderer.DrawRectangle(new Rectangle(x1, y1, columnWidth, columnHeight)); _renderer.PrepDrawString(Font, _foreColor); _renderer.DrawString(_columnDown.Text, new Rectangle(x1 + CellWidthPadding, y1 + textOffsetY, columnWidth, columnHeight)); }