Skip to content

Commit eb2366c

Browse files
author
armand
committed
Disabled hover effect when too many rectangles
1 parent 284120c commit eb2366c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mprof.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,9 @@ def mouse_click_handler(event):
620620
pl.draw()
621621
return
622622

623-
pl.gcf().canvas.mpl_connect('motion_notify_event', mouse_motion_handler)
623+
# Disable hovering if there are too many rectangle to prevent slow down
624+
if len(rectangles) < 100:
625+
pl.gcf().canvas.mpl_connect('motion_notify_event', mouse_motion_handler)
624626
pl.gcf().canvas.mpl_connect('button_release_event', mouse_click_handler)
625627

626628
if timestamps:

0 commit comments

Comments
 (0)