From de09aadc0e34e89f1a5bd671cc1e915e25cd0a29 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 13 Sep 2014 13:50:29 +0000 Subject: [PATCH] Hex Editor - dirty hack to prevent scrollbar value from being -1, why is it being -1 in the first place? meh --- BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index a1f6bef53c..772026a81e 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -2216,9 +2216,20 @@ namespace BizHawk.Client.EmuHawk } } + bool _programmaticallyChangingValue = false; private void HexScrollBar_ValueChanged(object sender, EventArgs e) { - UpdateValues(); + if (!_programmaticallyChangingValue) + { + if (HexScrollBar.Value < 0) + { + _programmaticallyChangingValue = true; + HexScrollBar.Value = 0; + _programmaticallyChangingValue = false; + } + + UpdateValues(); + } } protected override void OnShown(EventArgs e)