Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorАлександр Хухлаев <sancheolz@gmail.com>2020-04-23 17:58:46 +0300
committerGitHub <noreply@github.com>2020-04-23 17:58:46 +0300
commit82c4f32882e3786d7863b34126d2221128d7db00 (patch)
tree3f3676831d89bf5d21b830f9d5239aaa618c87df /mcs
parent946a479729fa218ddbfca3f3e19a97a1a3a2ac1a (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.cs2
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];
}