From 674b9b4c070982d9ee70a90fc88507091f48ac3f Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 23 Aug 2015 12:59:27 -0400 Subject: [PATCH] Hex Editor - issue #481 - keep scroll bar position when resetting the current rom as opposed to changing to a new one --- BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index f1d92b7419..7231abff49 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -136,6 +136,8 @@ namespace BizHawk.Client.EmuHawk // Do nothing } + private string _lastRom = string.Empty; + public void Restart() { _rom = GetRomBytes(); @@ -157,7 +159,13 @@ namespace BizHawk.Client.EmuHawk BigEndian = _domain.EndianType == MemoryDomain.Endian.Big; _maxRow = _domain.Size / 2; - ResetScrollBar(); + // Don't reset scroll bar if restarting the same rom + if (_lastRom != GlobalWin.MainForm.CurrentlyOpenRom) + { + _lastRom = GlobalWin.MainForm.CurrentlyOpenRom; + ResetScrollBar(); + } + SetDataSize(DataSize); UpdateValues(); AddressLabel.Text = GenerateAddressString();