-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -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"): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should fix that problem as well.
Added two new commits for fixing the rubberband in qt. The first adds a 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 two Also, changing the state of the rubberband doesn't trigger an agg buffer redraw anymore, freeing some CPU cycles while dragging. |
Moving on to #4972 |
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