@@ -841,6 +841,8 @@ def onmove(self, event):
841
841
'on mouse motion draw the cursor if visible'
842
842
if self .ignore (event ):
843
843
return
844
+ if not self .canvas .widgetlock .available (self ):
845
+ return
844
846
if event .inaxes != self .ax :
845
847
self .linev .set_visible (False )
846
848
self .lineh .set_visible (False )
@@ -907,7 +909,8 @@ def __init__(self, canvas, axes, useblit=True, **lineprops):
907
909
if useblit :
908
910
lineprops ['animated' ] = True
909
911
910
- self .lines = [ax .axvline (xmid , visible = False , ** lineprops ) for ax in axes ]
912
+ self .lines = [ax .axvline (xmid , visible = False , ** lineprops )
913
+ for ax in axes ]
911
914
912
915
self .visible = True
913
916
self .useblit = useblit
@@ -921,15 +924,20 @@ def __init__(self, canvas, axes, useblit=True, **lineprops):
921
924
def clear (self , event ):
922
925
'clear the cursor'
923
926
if self .useblit :
924
- self .background = self .canvas .copy_from_bbox (self .canvas .figure .bbox )
925
- for line in self .lines : line .set_visible (False )
927
+ self .background = self .canvas .copy_from_bbox (
928
+ self .canvas .figure .bbox )
929
+ for line in self .lines :
930
+ line .set_visible (False )
926
931
927
932
928
933
def onmove (self , event ):
929
- if event .inaxes is None : return
930
- if not self .canvas .widgetlock .available (self ): return
934
+ if event .inaxes is None :
935
+ return
936
+ if not self .canvas .widgetlock .available (self ):
937
+ return
931
938
self .needclear = True
932
- if not self .visible : return
939
+ if not self .visible :
940
+ return
933
941
934
942
for line in self .lines :
935
943
line .set_xdata ((event .xdata , event .xdata ))
0 commit comments