Skip to content

Commit 12e2474

Browse files
committed
fix: moving a column in TAStudio to near the end could scroll horizontally
1 parent 16c8312 commit 12e2474

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,13 +1660,9 @@ private void DoColumnReorder()
16601660
{
16611661
var oldIndex = _columns.IndexOf(_columnDown);
16621662
var newIndex = _columns.IndexOf(CurrentCell.Column);
1663+
_columns.Move(oldIndex, newIndex);
16631664

16641665
ColumnReordered?.Invoke(this, new ColumnReorderedEventArgs(oldIndex, newIndex, _columnDown));
1665-
1666-
//TODO surely this only works properly in one direction?
1667-
// also the event is "...Reordered"--past tense--so it should be called AFTER the change --yoshi
1668-
_columns.Remove(_columnDown);
1669-
_columns.Insert(newIndex, _columnDown);
16701666
}
16711667
}
16721668

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/RollColumns.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ public void ColumnsChanged()
8787
return result;
8888
}
8989

90+
public void Move(int oldIndex, int newIndex)
91+
{
92+
RollColumn col = this[oldIndex];
93+
_suspendChanged = true;
94+
RemoveAt(oldIndex);
95+
_suspendChanged = false;
96+
Insert(newIndex, col);
97+
}
98+
9099
public new int RemoveAll(Predicate<RollColumn> match)
91100
{
92101
var result = base.RemoveAll(match);

0 commit comments

Comments
 (0)