This change reduces the time it takes from selection until the annotation is visible to 10%. In my use case with around 4500 lines it previously took 47s. After this change it only takes around 5s. The workaround mentioned in the code is for a defect which was fixed in 2022.
Thanks for the report. I pushed a slightly different version which maintains back-compatibility with older versions of matplotlib, but should achieve the same speedup.
This change reduces the time it takes from selection until the annotation is visible to 10%. In my use case with around 4500 lines it previously took 47s. After this change it only takes around 5s. The workaround mentioned in the code is for a defect which was fixed in 2022.