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

Method _different_canvas

lib/matplotlib/artist.py:490–506  ·  view source on GitHub ↗

Check whether an *event* occurred on a canvas other that this artist's canvas. If this method returns True, the event definitely occurred on a different canvas; if it returns False, either it occurred on the same canvas, or we may not have enough information to know

(self, event)

Source from the content-addressed store, hash-verified

488 return []
489
490 def _different_canvas(self, event):
491 """
492 Check whether an *event* occurred on a canvas other that this artist's canvas.
493
494 If this method returns True, the event definitely occurred on a different
495 canvas; if it returns False, either it occurred on the same canvas, or we may
496 not have enough information to know.
497
498 Subclasses should start their definition of `contains` as follows::
499
500 if self._different_canvas(mouseevent):
501 return False, {}
502 # subclass-specific implementation follows
503 """
504 return (getattr(event, "canvas", None) is not None
505 and (fig := self.get_figure(root=True)) is not None
506 and event.canvas is not fig.canvas)
507
508 def contains(self, mouseevent):
509 """

Callers 14

containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80

Calls 1

get_figureMethod · 0.95

Tested by

no test coverage detected