@@ -1886,23 +1886,19 @@ def onmove(self, event):
1886
1886
if not self .ax .contains (event )[0 ]:
1887
1887
self .linev .set_visible (False )
1888
1888
self .lineh .set_visible (False )
1889
-
1890
1889
if self .needclear :
1891
1890
self .canvas .draw ()
1892
1891
self .needclear = False
1893
1892
return
1894
1893
self .needclear = True
1895
-
1896
1894
xdata , ydata = self ._get_data_coords (event )
1897
1895
self .linev .set_xdata ((xdata , xdata ))
1898
1896
self .linev .set_visible (self .visible and self .vertOn )
1899
1897
self .lineh .set_ydata ((ydata , ydata ))
1900
1898
self .lineh .set_visible (self .visible and self .horizOn )
1901
-
1902
- if self .visible and (self .vertOn or self .horizOn ):
1903
- self ._update ()
1904
-
1905
- def _update (self ):
1899
+ if not (self .visible and (self .vertOn or self .horizOn )):
1900
+ return
1901
+ # Redraw.
1906
1902
if self .useblit :
1907
1903
if self .background is not None :
1908
1904
self .canvas .restore_region (self .background )
@@ -1911,7 +1907,6 @@ def _update(self):
1911
1907
self .canvas .blit (self .ax .bbox )
1912
1908
else :
1913
1909
self .canvas .draw_idle ()
1914
- return False
1915
1910
1916
1911
1917
1912
class MultiCursor (Widget ):
@@ -2026,10 +2021,9 @@ def onmove(self, event):
2026
2021
for line in self .hlines :
2027
2022
line .set_ydata ((ydata , ydata ))
2028
2023
line .set_visible (self .visible and self .horizOn )
2029
- if self .visible and (self .vertOn or self .horizOn ):
2030
- self ._update ()
2031
-
2032
- def _update (self ):
2024
+ if not (self .visible and (self .vertOn or self .horizOn )):
2025
+ return
2026
+ # Redraw.
2033
2027
if self .useblit :
2034
2028
for canvas , info in self ._canvas_infos .items ():
2035
2029
if info ["background" ]:
0 commit comments