Skip to content

Commit

Permalink
Prevent out of range data grid scroll when lowering BPP.
Browse files Browse the repository at this point in the history
This was the true cause of #24
  • Loading branch information
bbbradsmith committed Oct 14, 2024
1 parent ad12656 commit 737f516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,9 @@ void redrawPreset()
r.Cells[2].Style.ForeColor = SystemColors.MenuHighlight;
dataGridPixel.Rows.Add(r);
}
// If new BPP has fewer entries, the scroll position might be invalid. The grid is large enough to show 8 entries.
if ((old_scroll + 8) >= dataGridPixel.Rows.Count) old_scroll = dataGridPixel.Rows.Count - 8;
if (old_scroll < 0) old_scroll = 0;
//if (old_scroll >= dataGridPixel.Rows.Count) old_scroll = 0;
dataGridPixel.FirstDisplayedScrollingRowIndex = old_scroll;
dataGridPixel.Enabled = !preset.chunky;

Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ Changes

1.6.3.0 (unreleased beta)
- Fix relative INI path edge case, when the target directory has a similar name to the INI directory.
- Fix intermittent crash bug when changing presets (re-entrant code).
- Fix inefficient UI updates which were accidentally recursive.
- Fix PixelView not updating scroll position on first open.
- Fix crash bug when lowering BPP and bit ordering grid was scrolled down too far.

1.6.2.0 (2024-10-13)
- Option persistence, INI file save and load.
Expand Down

0 comments on commit 737f516

Please sign in to comment.