MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / onmove

Method onmove

lib/matplotlib/widgets.py:2112–2146  ·  view source on GitHub ↗

Internal event handler to draw the cursor when the mouse moves.

(self, event)

Source from the content-addressed store, hash-verified

2110
2111 @_call_with_reparented_event
2112 def onmove(self, event):
2113 """Internal event handler to draw the cursor when the mouse moves."""
2114 if self.ignore(event):
2115 return
2116 if not self.canvas.widgetlock.available(self):
2117 return
2118 if not self.ax.contains(event)[0]:
2119 self.linev.set_visible(False)
2120 self.lineh.set_visible(False)
2121 if self.needclear:
2122 background = self._load_blit_background()
2123 if self.useblit and background is not None:
2124 self.canvas.restore_region(background)
2125 self.canvas.blit(self.ax.bbox)
2126 else:
2127 self.canvas.draw()
2128 self.needclear = False
2129 return
2130 self.needclear = True
2131 self.linev.set_xdata((event.xdata, event.xdata))
2132 self.linev.set_visible(self.visible and self.vertOn)
2133 self.lineh.set_ydata((event.ydata, event.ydata))
2134 self.lineh.set_visible(self.visible and self.horizOn)
2135 if not (self.visible and (self.vertOn or self.horizOn)):
2136 return
2137 # Redraw.
2138 if self.useblit:
2139 background = self._load_blit_background()
2140 if background is not None:
2141 self.canvas.restore_region(background)
2142 self.ax.draw_artist(self.linev)
2143 self.ax.draw_artist(self.lineh)
2144 self.canvas.blit(self.ax.bbox)
2145 else:
2146 self.canvas.draw_idle()
2147
2148
2149class MultiCursor(Widget):

Callers

nothing calls this directly

Calls 12

availableMethod · 0.80
_load_blit_backgroundMethod · 0.80
set_xdataMethod · 0.80
set_ydataMethod · 0.80
ignoreMethod · 0.45
containsMethod · 0.45
set_visibleMethod · 0.45
restore_regionMethod · 0.45
blitMethod · 0.45
drawMethod · 0.45
draw_artistMethod · 0.45
draw_idleMethod · 0.45

Tested by

no test coverage detected