Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix span stay blit #5681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 15, 2015
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
ENH: when re-drawing the span clear previous span
Force a full re-draw on the last span is not in the blit background
  • Loading branch information
tacaswell committed Dec 15, 2015
commit a8934dcc74f6fd877bd95e1fff944e37033ee2ce
5 changes: 4 additions & 1 deletion 5 lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why is this necessary? Is this essentially forcing a remake of the background buffer? Should these events be responsible for triggering direct draw calls? Why can't this be deferred to later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the stay rectangle is present then the background that is grabbed will include it, by forcing the draw here it is removed from the background used for blitting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the background include it? The artist has been set to be
invisible, thereby making things stale. Shouldn't it then remake the
background automatically at the next draw?

On Tue, Dec 15, 2015 at 11:33 AM, Thomas A Caswell <notifications@github.com

wrote:

In lib/matplotlib/widgets.py
#5681 (comment):

@@ -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()
    

If the stay rectangle is present then the background that is grabbed will
include it, by forcing the draw here it is removed from the background used
for blitting.


Reply to this email directly or view it on GitHub
https://github.com/matplotlib/matplotlib/pull/5681/files#r47660978.

xdata, ydata = self._get_data(event)
if self.direction == 'horizontal':
self.pressv = xdata
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.