diff options
author | Александр Хухлаев <sancheolz@gmail.com> | 2020-04-23 17:58:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 17:58:46 +0300 |
commit | 82c4f32882e3786d7863b34126d2221128d7db00 (patch) | |
tree | 3f3676831d89bf5d21b830f9d5239aaa618c87df /mcs | |
parent | 946a479729fa218ddbfca3f3e19a97a1a3a2ac1a (diff) |
[WinForms] Fix ListView GetItemAt high load (#19639)
When ListView.VirtualMode = true GetItemAt should not access items collection directly to
get bounds of ListViewItem. Otherwise, method OnRetrieveVirtualItem will be called.
Which costs a lot of time.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs index a8854afd6ef..13cda57f3ab 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs @@ -3852,7 +3852,7 @@ namespace System.Windows.Forms { Size item_size = ItemSize; for (int i = 0; i < items.Count; i++) { - Rectangle item_rect = items [i].Bounds; + Rectangle item_rect = new Rectangle(GetItemLocation(i), item_size); if (item_rect.Contains (x, y)) return items [i]; } |