Skip to content

Commit

Permalink
Merge pull request matplotlib#5681 from tacaswell/fix_span_stay_blit
Browse files Browse the repository at this point in the history
Fix span stay blit
  • Loading branch information
mdboom committed Dec 15, 2015
2 parents 47dded2 + 8bc19ec commit e8d8451
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ def new_axes(self, ax):
transform=trans,
visible=False,
**self.rectprops)
self.stay_rect.set_animated(False)
self.ax.add_patch(self.stay_rect)

self.ax.add_patch(self.rect)
Expand All @@ -1487,7 +1488,10 @@ def _press(self, event):
self.rect.set_visible(self.visible)
if self.span_stays:
self.stay_rect.set_visible(False)

# really force a draw so that the stay rect is not in
# the blit background
if self.useblit:
self.canvas.draw()
xdata, ydata = self._get_data(event)
if self.direction == 'horizontal':
self.pressv = xdata
Expand All @@ -1510,7 +1514,7 @@ def _release(self, event):
self.stay_rect.set_height(self.rect.get_height())
self.stay_rect.set_visible(True)

self.canvas.draw()
self.canvas.draw_idle()
vmin = self.pressv
xdata, ydata = self._get_data(event)
if self.direction == 'horizontal':
Expand Down

0 comments on commit e8d8451

Please sign in to comment.