mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-08 20:30:47 +00:00
Recalculate list indices after adding or removing lines
Minor display list bug that presented itself when a 3-line note was deleted.
This commit is contained in:
parent
12874d32ba
commit
380c56a4ef
@ -315,6 +315,7 @@ namespace SourceGenWPF {
|
||||
|
||||
if (oldCount != newCount) {
|
||||
SelectedIndices = new DisplayListSelection(mList.Count);
|
||||
RecalculateListIndices();
|
||||
}
|
||||
|
||||
OnPropertyChanged(CountString);
|
||||
@ -322,6 +323,18 @@ namespace SourceGenWPF {
|
||||
OnCollectionReset();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recalculates the list index fields after lines are added or removed.
|
||||
/// </summary>
|
||||
private void RecalculateListIndices() {
|
||||
Debug.WriteLine("Recalculating list indices");
|
||||
for (int i = 0; i < mList.Count; i++) {
|
||||
if (mList[i] != null) {
|
||||
mList[i].ListIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List elements. Instances are immutable.
|
||||
/// </summary>
|
||||
|
@ -2267,7 +2267,7 @@ namespace SourceGenWPF {
|
||||
/// is selected.</param>
|
||||
public SelectionState UpdateSelectionState() {
|
||||
int selCount = mMainWin.CodeListView_GetSelectionCount();
|
||||
Debug.WriteLine("SelectionChanged, selCount=" + selCount);
|
||||
Debug.WriteLine("SelectionChanged: selCount=" + selCount);
|
||||
|
||||
SelectionState state = new SelectionState();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user