-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add support for blitting in qt5cairo. #17478
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
Test with e.g. examples/event_handling/poly_editor.py. Doing the same for the other foocairo backends is left as an exercise to the reader.
edit: moved blit() to the Qt5 base class, avoiding duplication -- and now mplcairo can use it too. |
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.
LGTM (and runs correctly on my machine!)
# repaint uses logical pixels, not physical pixels like the renderer. | ||
l, b, w, h = [pt / self._dpi_ratio for pt in bbox.bounds] | ||
t = b + h | ||
self.repaint(l, self.rect().height() - t, w, h) |
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.
OK, I can't find it - does qt5agg have a rect
method? an is self.rect().height()
equal to self.renderer.height / self._dpi_ratio
?
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.
Yes, that comes to us from qt directly: https://doc.qt.io/qt-5/qwidget.html#rect-prop.
Test with e.g. examples/event_handling/poly_editor.py.
Doing the same for the other foocairo backends is left as an exercise to
the reader.
cf. #10187 (comment).
PR Summary
PR Checklist