From 12c64dc40dd175ef0a06aedd62b0f5528cc7d373 Mon Sep 17 00:00:00 2001 From: "J.D. Purcell" Date: Sun, 27 Oct 2019 11:45:42 -0400 Subject: [PATCH] InputRoll: Fix text clipping too early with GDI+ renderer. --- .../CustomControls/InputRoll/InputRoll.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 9ea372f611..7488101d84 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -91,7 +91,13 @@ namespace BizHawk.Client.EmuHawk using (var g = CreateGraphics()) using (_renderer.LockGraphics(g, Width, Height)) { - _charSize = _renderer.MeasureString("A", _font); // TODO make this a property so changing it updates other values. + // Set font + _renderer.PrepDrawString(_font, _foreColor); + + // Measure width change to ignore extra padding at start/end + var size1 = _renderer.MeasureString("A", _font); + var size2 = _renderer.MeasureString("AA", _font); + _charSize = new Size(size2.Width - size1.Width, size1.Height); // TODO make this a property so changing it updates other values. } UpdateCellSize();