Skip to content

Commit

Permalink
Add missing SuspendPaint in SelectWhere, UnselectWhere
Browse files Browse the repository at this point in the history
SuspendPaint was missing to match the ResumePaint call in these two functions, thus throwing off the counter, and causing all kinds of visual issues when attempting to use these functions.
  • Loading branch information
trigger-segfault authored Aug 29, 2023
1 parent 4ca2d48 commit b4f81df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ImageListView/ImageListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,8 @@ public void InvertSelection()
/// </summary>
public void SelectWhere(Func<ImageListViewItem, bool> predicate)
{
SuspendPaint();

foreach (ImageListViewItem item in Items.Where(predicate))
item.mSelected = true;

Expand All @@ -1120,6 +1122,8 @@ public void SelectWhere(Func<ImageListViewItem, bool> predicate)
/// </summary>
public void UnselectWhere(Func<ImageListViewItem, bool> predicate)
{
SuspendPaint();

foreach (ImageListViewItem item in Items.Where(predicate))
item.mSelected = false;

Expand Down

0 comments on commit b4f81df

Please sign in to comment.