Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,18 @@ def __init__(self, ax, *, horizOn=True, vertOn=True, useblit=False,
self.vertOn = vertOn
self.useblit = useblit and self.canvas.supports_blit # TODO: make dynamic

# --- NEW CODE: Check for overlapping axes and fallback ---
Comment thread
QuLogic marked this conversation as resolved.
Outdated
if self.useblit:
for ax_ in ax.get_figure(root=True).get_axes():
if ax_ is not ax and ax.bbox.overlaps(ax_.bbox):
_api.warn_external(
"Cursor blitting is currently not supported on "
"overlapping axes; falling back to useblit=False."
)
self.useblit = False
break
# ---------------------------------------------------------
Comment thread
QuLogic marked this conversation as resolved.
Outdated

if self.useblit:
lineprops['animated'] = True
self.lineh = ax.axhline(ax.get_ybound()[0], visible=False, **lineprops)
Expand Down Expand Up @@ -2119,11 +2131,12 @@ def onmove(self, event):
self.lineh.set_visible(self.visible and self.horizOn)
if not (self.visible and (self.vertOn or self.horizOn)):
return
# Redraw.
# Redraw.
Comment thread
QuLogic marked this conversation as resolved.
Outdated
if self.useblit:
background = self._load_blit_background()
if background is not None:
self.canvas.restore_region(background)

Comment thread
QuLogic marked this conversation as resolved.
Outdated
self.ax.draw_artist(self.linev)
self.ax.draw_artist(self.lineh)
self.canvas.blit(self.ax.bbox)
Expand Down
Loading