Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Qt5: Add flag that informs paintEvent if the agg buffer needs to updated, fix rubberband#4962

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
pwuertz wants to merge3 commits intomatplotlib:masterfrompwuertz:qt5_agg_redraw_flag

Conversation

pwuertz
Copy link
Contributor

Added a flag for determining if paintEvent needs to update the agg buffer or not. The buffer is updated when draw_idle triggers the paintEvent and the buffer is considered valid after using draw and when using blit.

Discussion in#4943, Speed up Example in#4947

@@ -71,7 +71,11 @@ def paintEvent(self, e):
In Qt, all drawing should be done inside of here when a widget is
shown onscreen.
"""
FigureCanvasAgg.draw(self)
if not hasattr(self, "_agg_redraw_flag"):
Copy link
Member

Choose a reason for hiding this comment

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

This should go in the init so it is always defined.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It should, but this is seems to be a Mixin for which the init method is not called at all.

Copy link
Member

Choose a reason for hiding this comment

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

Then we should fixthat problem as well.

@tacaswelltacaswell added this to thenext point release milestoneAug 19, 2015
@pwuertzpwuertz changed the titleQt5: Add flag that informs paintEvent if the agg buffer needs to updatedQt5: Add flag that informs paintEvent if the agg buffer needs to updated, fix rubberbandAug 20, 2015
@pwuertz
Copy link
ContributorAuthor

Added two new commits for fixing the rubberband in qt. The first adds aremove_rubberband() handler tobackend_bases that is invoked when the zoom rectangle is released.

The other commit changes the rubberband handling in the qt backend to utilize the rubberband removal handler. The previous solution was to simply remove the rectangle after each draw. This method fails when there is an additional paintEvent between twodraw_rubberband() calls because it clears the rubberband while it is still being dragged (flicker). Also, there is the chance that the paintEvent requested by the lastdraw_rubberband() call before releasing the mouse might get delayed until after thedraw_idle() call for zooming in. This causes the rubberband to be drawn on top of the zoomed-in figure (bad) and since there are no more events after the release the rubberband will stay on screen (worse).

Also, changing the state of the rubberband doesn't trigger an agg buffer redraw anymore, freeing some CPU cycles while dragging.

@pwuertz
Copy link
ContributorAuthor

Moving on to#4972

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v1.5.0
Development

Successfully merging this pull request may close these issues.

2 participants
@pwuertz@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp