From cebbdc63c801b05665bf22458f2b1a9b6bc32a79 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Tue, 3 Jun 2025 11:46:30 +0300 Subject: [PATCH] Bug fixed: Nothing selected after removing a symbol. Potential error throw on "Apply" --- McBitFont/Form1.cs | 3 +++ TODO.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/McBitFont/Form1.cs b/McBitFont/Form1.cs index e2d483d..39cda8a 100644 --- a/McBitFont/Form1.cs +++ b/McBitFont/Form1.cs @@ -1035,8 +1035,11 @@ namespace McBitFont { var sel = miniList.SelectedItems[0].ImageKey; int code = Convert.ToInt32(miniList.SelectedItems[0].ImageKey); FrameMiniature ff = frames.Find(x => x.code == code); + bool isLast = frames.Last().Equals(ff); frames.Remove(ff); miniList.SelectedItems[0].Remove(); + + miniList.Items[isLast ? miniList.Items.Count - 1 : 0].Selected = true; } private void prependSymbolToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/TODO.txt b/TODO.txt index a493be2..1d91468 100644 --- a/TODO.txt +++ b/TODO.txt @@ -8,4 +8,4 @@ V Straight line painting (hold Shift / Ctrl) V A button to Copy from Test font dialog to then paste into another frame Bugs: -- Nothing selected after removing a symbol. Potential error throw on "Apply" \ No newline at end of file +V Nothing selected after removing a symbol. Potential error throw on "Apply" \ No newline at end of file