fix header update during single-table mode

This commit is contained in:
Haven1433
2022-08-19 22:13:46 -05:00
parent 216887b7d7
commit b19dda6701
2 changed files with 5 additions and 2 deletions

View File

@@ -179,6 +179,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
NotifyPropertyChanged(nameof(MinimumScroll));
NotifyPropertyChanged(nameof(MaximumScroll));
NotifyPropertyChanged(nameof(DataLength));
UpdateHeaders();
}
public void ClearTableMode() => SetTableMode(0, 0);

View File

@@ -312,8 +312,10 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
}
private void GotoAddressAndAlign(int address, int preferredWidth, int tableStart = 0) {
Scroll.ClearTableMode();
Debug.Assert(Scroll.DataLength == model.Count, "I forgot to update the Scroll.DataLength after expanding the data!");
if (address < Scroll.DataStart || Scroll.DataLength < address) {
Scroll.ClearTableMode();
Debug.Assert(Scroll.DataLength == model.Count, "I forgot to update the Scroll.DataLength after expanding the data!");
}
var startAddress = address;
if (preferredWidth > 1) address -= (address - tableStart) % preferredWidth;